2 Replies Latest reply on Nov 5, 2002 9:27 AM by Tobias Frech

    How to avoid CTRL-C shutdown

    Sebastian Hallensleben Newbie

      === Problem: ===

      JBoss adds a shutdown hook that listens to kill signals from the OS. On Solaris, some shells (in particular sh) seem to trigger a kill signal when pressing CTRL-C in a console, which then shuts down JBoss.

      In other words, pressing CTRL-C on the console from which JBoss was started shuts it down again. This happens even when JBoss is started as a background process / using nohup, and CTRL-C is used much later e.g. to get out of a tail -f.

      The same problem arises when telnetting into a Solaris box to start JBoss. Whenever the telnet session is terminated in any way (logging out, timeout etc.), JBoss shuts down again.

      === Solution: ===

      Christer suggested the following solution which works fine for me: Add the -Xrs switch to the java command in the startup script. This prevents JBoss from adding a shutdown hook - see http://java.sun.com/j2se/1.3/docs/tooldocs/win32/java.html for documentation on the switch.

      More details about problem and solution are in this thread:
      http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ thread also describes an alternative perl based solution to the problem.

      Hope this is helpful.