- 
        15. Re: Avoid shutdown with CTRL-C?sebaseba Oct 9, 2002 11:55 AM (in response to sebaseba)The -Xrs switch did the trick - thanks Christer :-) 
 JBoss complains at startup about not being able to add a shutdown hook, but that is presumably exactly what is intended:
 [15:55:43,628,Shutdown] Could not add shutdown hook
 java.lang.IllegalArgumentException: Signal already used by VM: SIGHUP
 at sun.misc.Signal.handle(Signal.java:152)
 at java.lang.Terminator.setup(Terminator.java:42)
 at java.lang.Shutdown.add(Shutdown.java:88)
 at java.lang.Runtime.addShutdownHook(Runtime.java:193)
 at org.jboss.util.Shutdown.preRegister(Shutdown.java:49)
 at com.sun.management.jmx.MBeanServerImpl.preRegisterInvoker(MBeanServer
 Impl.java:2245)
 at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.ja
 va:513)
 at javax.management.loading.MLet.getMBeansFromURL(MLet.java:523)
 at javax.management.loading.MLet.getMBeansFromURL(MLet.java:369)
 at org.jboss.Main.(Main.java:180)
 at org.jboss.Main$1.run(Main.java:110)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.jboss.Main.main(Main.java:106)
 Just for the record: This was with JBoss 2.4.4, JDK 1.3.1_b24, and a standard Solaris 2.8 installation.
 /Sebastian
- 
        16. Re: Avoid shutdown with CTRL-C?lordy Oct 9, 2002 12:17 PM (in response to sebaseba)Darn I just spent all day trying to stop JBoss shutting down 
 (on Solaris again!). All combinations of nohup and & and redirections would not stop JBoss dying. Even if it was in the background typing CTRL-C in the terminal to stop any other process would also kill it!!!
 My solution below for a bit of variety was to edit the run.sh file and replace
 exec $JAVA .......
 with
 perl -e 'setpgrp(); exec @ARGV;' $JAVA ......
 This makes it a leader of its process group and detaches it from the terminal. And for good measure you can tag
 </dev/null 2>&1 >/dev/null &
 on the end of the line.
 HTH
 Lordy
- 
        17. Re: Avoid shutdown with CTRL-C?juha Oct 9, 2002 5:04 PM (in response to sebaseba)guys, 
 can you post some of this to the FAQ? at least the '-Xrs' switch seems interesting (I had no idea it existed!)
- 
        18. Re: Avoid shutdown with CTRL-C?lordy Oct 10, 2002 7:21 AM (in response to sebaseba)I haven't tested but wouldnt using -Xrs switch stop JBoss 
 shutting down nicely if someone types 'kill PID' ???
 Lordy
- 
        19. Re: Avoid shutdown with CTRL-C?sebaseba Oct 10, 2002 7:32 AM (in response to sebaseba)> guys, 
 >
 > can you post some of this to the FAQ? at least the
 > '-Xrs' switch seems interesting (I had no idea it
 > existed!)
 >
 Done.
 /Sebastian
- 
        20. JB killing my servlets to quick (Re: Avoid shutdown with CTRlordy Oct 10, 2002 7:48 AM (in response to sebaseba)Just did a quick test. -Xrs stops a clean shutdown from a kill signal but the shutdown.sh still works OK. 
 The perl setpgrp() works OK for a kill PID (and I'm assuming a shutdown.sh too )
 But worryingly I've just noticed, that JBoss is stopping my web application dead in its tracks and not allowing it to shut down gracefully like JRun was. I have two servlets doing a lot of administrative stuff and they need to be shut down cleanly by the server. Any Ideas ?
- 
        21. Re: JB killing my servlets to quick (Re: Avoid shutdown withlordy Oct 14, 2002 7:33 PM (in response to sebaseba)Guys & Gals, 
 I know its in the FAQ but using java -Xrs stops JBoss 3.0.2 shutting down properly from a kill signal. (thought it still works OK from shutdown.sh).
 The perl "setpgrp" thingy works better in this respect. Maybey I just want my name in lights but I think the FAQ should point this out :)
 [This all seems to be a Solaris issue BTW]
 Lordy
 
     
    