I’ve been playing with the Java based Hudson Continuous Build Server and have really become a big fan of it. I created a quick and dirty SMF manifest for getting the server up and running under Solaris 10. SMF is the Solaris equivalent of UNIX init.d, Apple’s launchd, or Windows services.
Looking at the hudson smf manifest file you can see that I am simply declaring it as a startd child process. For this reason you don’t need separate method scripts. You can (and probably should) change the HUDSON_HOME environment variable in the xml file or remove it completely. The —prefix option tells the embedded Winstone server to make your application available at http://localhost:8080/hudson/
First download the latest Hudson war file and copy it into
Next download the hudson manifest file and place it in:
Import it into the smf system and enable it:
$ sudo /usr/sbin/svccfg import var/svc/manifest/local/hudson.xml $ sudo /usr/sbin/svcadm enable hudson
You can then check the log file and see that it’s coming up:
$tail -f /var/svc/log/application-hudson\:default.log [ May 1 18:58:15 Executing start method ("java -Xmx512m -DHUDSON_HOME=/apps/hudson/ -jar /apps/hudson/hudson.war --prefix=/hudson") ] [ May 1 18:58:15 Ignoring duplicate environment variable "PATH=/usr/sbin:/usr/bin". ] [Winstone 2007/05/01 18:58:18] - Beginning extraction from war file [Winstone 2007/05/01 18:58:23] - No webapp classes folder found - /var/tmp/winstone/hudson.war/WEB-INF/classes ...
Use the Solaris svcs command to check the server’s status:
$svcs -l hudson fmri svc:/application/hudson:default name Hudson Continuous Build Server enabled true state online next_state none state_time Tue May 01 18:58:16 2007 logfile /var/svc/log/application-hudson:default.log restarter svc:/system/svc/restarter:default contract_id 5836 dependency require_all/none svc:/milestone/multi-user-server (online)
If something is wrong, you will see the reason for the failure output here.
Check out your new build server at http://localhost:8080/hudson/
Big thanks go out to the Hudson team for their work on this system.
Update (Jan, 2011)
I still get a lot of hits on this page from people looking for an example of how to do this. To make it easier for everyone, I’ve created this file as a github gist that should be easier to copy and track changes to.