Index: run.sh =================================================================== --- run.sh (revision 62448) +++ run.sh (working copy) @@ -183,28 +183,23 @@ -classpath "$JBOSS_CLASSPATH" \ org.jboss.Main "$@" & JBOSS_PID=$! - # Trap common signals and relay them to the jboss process + # Trap common signals and relay them to the background JBossAS process trap "kill -HUP $JBOSS_PID" HUP trap "kill -TERM $JBOSS_PID" INT trap "kill -QUIT $JBOSS_PID" QUIT trap "kill -PIPE $JBOSS_PID" PIPE trap "kill -TERM $JBOSS_PID" TERM - # Wait until the background process exits - WAIT_STATUS=0 - while [ "$WAIT_STATUS" -ne 127 ]; do - JBOSS_STATUS=$WAIT_STATUS - wait $JBOSS_PID 2>/dev/null - WAIT_STATUS=$? - done + # Wait until the background JBossAS process exits + wait $JBOSS_PID 2>/dev/null + JBOSS_STATUS=$? fi # If restart doesn't work, check you are running JBossAS 4.0.4+ # http://jira.jboss.com/jira/browse/JBAS-2483 # or the following if you're running Red Hat 7.0 # http://developer.java.sun.com/developer/bugParade/bugs/4465334.html - if [ $JBOSS_STATUS -eq 10 ]; then + if [ "$JBOSS_STATUS" -eq 10 ]; then echo "Restarting JBoss..." else exit $JBOSS_STATUS fi done -