This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Execute Script/Batch file: stuck
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 29, 2012
11:36 AM
Execute Script/Batch file: stuck
Hi,
I'm trying to wrap a RMI server application as service, which will check the RMI server exit code and restart it under certain conditions.
Everything works perfect if I setup the service through command line. When I tried it through Execute Script/Batch file in IA 2008, it also worked perfect on Solaris. But it got stuck on Red Hat Enterprise 5.6.
The script I tried to run via IA is as follows:
if [ `uname | grep -i Linux` > /dev/null ]; then
/bin/bash -c "service swdagent start&"
else
svcadm enable swdagent
fi
The service setup script is like the following:
# /etc/init.d/ script
start_agent()
{
errCode=1
while [ "$errCode" -ne 0 ]; do
$JAVA_EXEC $J_OPTS com.swd.rmi.SwdAgent agent_status
if [ "$?" -ne 0 ]; then
echo "The swd agent is already running."
errCode=0
echo
else
echo "Starting swd agent"
nohup \
$JAVA_EXEC $J_OPTS com.swd.rmi.SwdAgent > /dev/null 2>&1
errCode=$?
if [ "$errCode" -eq 5 ]; then
errCode=0
echo "Failed to bind RMI Service"
fi
fi
done
}
# main
......
case "$1" in
start)
echo
start_agent &
echo
;;
.......
The behavior is same if I enable service through java Runtime.exec() - worked perfect on Solaris and stuck on RHEL.
Any expert there can shed some light n how to get around this?
Thanks a lot,
Ben
I'm trying to wrap a RMI server application as service, which will check the RMI server exit code and restart it under certain conditions.
Everything works perfect if I setup the service through command line. When I tried it through Execute Script/Batch file in IA 2008, it also worked perfect on Solaris. But it got stuck on Red Hat Enterprise 5.6.
The script I tried to run via IA is as follows:
if [ `uname | grep -i Linux` > /dev/null ]; then
/bin/bash -c "service swdagent start&"
else
svcadm enable swdagent
fi
The service setup script is like the following:
# /etc/init.d/ script
start_agent()
{
errCode=1
while [ "$errCode" -ne 0 ]; do
$JAVA_EXEC $J_OPTS com.swd.rmi.SwdAgent agent_status
if [ "$?" -ne 0 ]; then
echo "The swd agent is already running."
errCode=0
echo
else
echo "Starting swd agent"
nohup \
$JAVA_EXEC $J_OPTS com.swd.rmi.SwdAgent > /dev/null 2>&1
errCode=$?
if [ "$errCode" -eq 5 ]; then
errCode=0
echo "Failed to bind RMI Service"
fi
fi
done
}
# main
......
case "$1" in
start)
echo
start_agent &
echo
;;
.......
The behavior is same if I enable service through java Runtime.exec() - worked perfect on Solaris and stuck on RHEL.
Any expert there can shed some light n how to get around this?
Thanks a lot,
Ben
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 28, 2012
02:08 AM
Have you tried to manually run the script on RH5.6, of course, with the IA variables replaced?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 04, 2012
02:51 PM
It works fine if run from command line.
If installanywhere users java Runtime to execute the script, then I believe it's the java Runtime issue. When I run the script directly through java Rumtime, it's also stuck.
Using java Runtime to execute script/batch file is OS-dependent, that explains why it succeeded on Soalris, but stuck on Linux.
If installanywhere users java Runtime to execute the script, then I believe it's the java Runtime issue. When I run the script directly through java Rumtime, it's also stuck.
Using java Runtime to execute script/batch file is OS-dependent, that explains why it succeeded on Soalris, but stuck on Linux.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2012
02:46 AM
This script, do you run it verbatim (as is) inside InstallAnywhere?