Running JBoss 6 with Runit / daemontools or other process supervision framework
- by Alex Recarey
I'm tying to use runit to daemonize JBoss.
I use the /opt/jboss-6.1.0.Final/bin/run.sh script to start the server. When I do so from the comandline, JBoss does not detach (which is what we want), and will also shut down when CTRL+C is pressed. In theory a perfect candidate to use runit on.
Everything works fine except when I try to get runit to shut down JBoss. When I issue the command sv stop jboss nothing happens. Runit thinks the process is stopped but jboss continues to run normally.
I'm not doing anything special with the run script. This is my runit run script:
#!/bin/sh
exec 2>&1
exec /opt/jboss-6.1.0.Final/bin/run.sh -c standard -b 0.0.0.0
Looking at the jboss_init_redhat.sh script, the start section does mention ./bin/run.sh but the stop section has the following text:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}
Any ideas of what I could try?