You may want to look into jsvc - this has some similar capabilities. For example, have a look at the init script for tomcat - this should be a good templateHi All, I am trying to run some Java programs under daemontools and it is working quite well. Except they are running as root and I would like to make them run as www-data. I found the daemontools "setuidgid" program which works for well for starting up the application but then daemontools cannot shut the application down again. Here is an example of the daemontools run job - #!/bin/bash # /etc/service/myapplication/run startup script source /etc/default/myapplication exec setuidgid www-data java -jar /opt/webapps/myapplication.jar --port 9000 --headless >> /opt/logs/myapplication.log 2>&1
when I leave out the setuidgid stuff then I am able to start and stop the application. But with the above example the shutdown signal does not seem to reach the Java process even though I am using exec.
Karl E. Jørgensen