1 Reply Latest reply on Oct 23, 2009 1:44 AM by jaikiran pai

    JBoss service shutdown upon user logout

    Daniel Kranowski Newbie

      I was going to post this as a question but we got the answer so I thought I'd post that instead. The root cause is Windows/Java not JBoss but I hope no one minds me posting it here.

      We have jboss-5.0.0.GA deployed on Win XP and Win 2003 servers. We deployed it as a windows service using Activeplus ServiceMill. We did not use %JBOSS_DIST%\bin\service.bat because the accompanying jbosssvc.exe did not work for us. The service was set to run as user XYZ. What we found was that if we logged in as any user (could be different from XYZ), then logged out, Win XP would terminate the jboss service. The behavior did not occur on Win 2003. In server.log, the termination looked like any normal shutdown, the question was just "what is making it shutdown?":

      2009-10-19 08:59:32,867 INFO [org.jboss.bootstrap.microcontainer.ServerImpl] (JBoss Shutdown Hook) Runtime shutdown hook called, forceHalt: true
      


      The problem was solved by copying this from service.bat to run.bat:

      REM Suppress killing service on logoff event
      set JAVA_OPTS=-Xrs
      


      http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html: java -Xrs suppresses kill signals.

      So what I learned here and hope to share is that Win XP sends a kill signal to user processes upon logout, and Win 2003 does not. And "java -Xrs" tells the jboss jvm to ignore the kill signal.