Execute Script/Batch file: stuck
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&"
svcadm enable swdagent
The service setup script is like the following:
# /etc/init.d/ script
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."
echo "Starting swd agent"
$JAVA_EXEC $J_OPTS com.swd.rmi.SwdAgent > /dev/null 2>&1
if [ "$errCode" -eq 5 ]; then
echo "Failed to bind RMI Service"
case "$1" in
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,
Have you tried to manually run the script on RH5.6, of course, with the IA variables replaced?
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.
This script, do you run it verbatim (as is) inside InstallAnywhere?