Posted by kohsuke
on February 10, 2009 at 3:32 PM PST
Hudson can now behave like a real Unix daemon.
Starting 1.281, Hudson can now launch itself as a proper Unix daemon. All you have to do is start Hudson as:
$ java -jar hudson.war --daemon
If you run this as root, it'll leave /var/run/hudson.pid and record PID there. Unlike java -jar hudson.war &, this will detach the daemon from the shell properly, so it'll keep going even after you exit your shell. This is done by using akuma that I blogged earlier .
Similarly, when you run Hudson with the --logfile=/path/to/hudson.log option, stdout/stderr from Hudson are redirected to a log file. In addition, Hudson will respond to SIGALRM and reopens a log file, which makes Hudson friendlier to log rotation like logadm on Solaris or logrotate on Linux.