[jboss-dev-forums] [Other JBoss Development Design] - Re: run.sh to launch JBoss in background
ips
do-not-reply at jboss.com
Fri Oct 6 09:59:30 EDT 2006
+1 - I like it because it encapsulates all the complexity in run.sh, and the user can simply treat the run.sh process as if it is the JBoss process itself.
So we'd have to add a line like the following to run.sh for each signal we want to relay:
trap "kill -1 $JBOSS_PID" 1
I guess, at a minimum, we'd want to support 1 (HUP), 10 (JBoss restart), and 15 (TERM).
Or you could use something like the following to support all signals:
i=0
while [ "$i" -le 64 ]; do
[ "$i" -ne 9 ] && [ "$i" -ne 19 ] && trap "kill -$i $JBOSS_PID" $i
i=`expr $i + 1`
done
Note, I skip 9 (KILL) and 19 (STOP), because these can't be trapped, and POSIX impls of trap are not required to even allow them as args. I'm not sure if the max signal number on Solaris, HP-UX, etc. is 64, as it is on Linux, so some testing would be required there in order to make sure the above while loop is portable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976595#3976595
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976595
More information about the jboss-dev-forums
mailing list