I'm also having a problem with this, but what I'm seeing is that even with nohup and trap on every signal, JBoss will always exit when either of these two things happen:
- press control-c in the window I issued the start command in (it's running in the background, not foreground)
- exit the login shell that I issued the start command in
This one is driving me nuts. I'm starting to think it's a sh bug, because I've never had problems like this on writing an init script before!
As I posted in a similar thread, the culprit turned out to be that /bin/sh on Solaris was leaving JBoss connected to the tty as standard input, even though the process was backgrounded.
Try redirecting stdin from /dev/null, IE:
java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main $@ > $JBOSS_DIST/log/server.output 2>&1 < /dev/null &
I dont understand the Try redirecting stdin from /dev/null
Can someone explain?