Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Hudson-ci/Installing Hudson Unix Daemon

{hudson|pageTitle=Installing Hudson as a Unix Daemon}}

Some Available Options

Linux startup script

  • Sample Startup Script - a simple shell script enabling to start, stop, and restart hudson from /etc/init.d


Daemonize is a very simple program that allows you to launch Hudson (or any arbitrary program) as a daemon. For people without much Unix experience, this is recommended.


daemontools is another possibility. This is more complicated to set up and it doesn't really follow the normal Unix convention, but it offers daemon control (like start/stop), log capturing, as well as automatic restart when the service dies.

Shell script

        # Daemonize
        echo -n $"Starting $SERVICE: "
        touch /var/run/
        chown hudson:hudson /var/run/
        su -s /bin/sh hudson -c "
                cd /
                HUDSON_HOME=/var/lib/hudson exec setsid /usr/bin/java   \
                        -jar /usr/share/java/hudson/hudson.war          \
                        $HUDSON_OPTS                                    \
                </dev/null >>/var/log/hudson/console_log 2>&1 &
                echo \$! >/var/run/
                disown \$!

Adjust the above as needed

Java Service Wrapper

The Java Service wrapper is a wrapper that works both on Unix and Windows. It requires some set up but when it is setup it can be used as any other unix service (like start/stop).

This example will install a hudson instance in */home/hudson* on a debian machine. The Hudson configuration is stored in /home/hudson/data. Hudson will be running on port 8070 and as the hudson user.

  1. Select and download a JSW package from the JSW wrapper download page.
  2. Unpack the package into the /home/hudson path.
  3. Create /home/hudson/tmp as the temporary directory for JSW.
  4. Download the Hudson.war file into /home/hudson/lib.
    • If you have plugins that you would like to use, download them into /home/hudson/data/plugins.
  5. Copy the /home/hudson/src/conf/ to /home/hudson/conf/wrapper.conf and change the below configuration properties in the file. 

#Set directly the time zone of the JVM, by setting this we do not rely on the time zone of the server. 
#Uncomment the following line if needed. wrapper.jvm_exit.timeout=60 

wrapper.console.title=Hudson Continuous build server
  1. Verify the wrapper configuration by starting Hudson through /home/hudson/bin/testwrapper console. Hudson should be accessible through http://localhost:8070, if not check the console output for errors.
  2. Copy the /home/hudson/src/bin/ to /etc/init.d/hudson and change the below configuration properties in the file.
APP_NAME="Hudson" APP_LONG_NAME="Hudson Continuous build server" 
WRAPPER_CMD="/home/hudson/bin/wrapper" WRAPPER_CONF="/home/hudson/conf/wrapper.conf" 
  1. Verify installation by starting the daemon through /etc/init.d/hudson start. Make sure that /etc/init.d/hudson has the correct permissions; normaly 755 is ok for this.


Ubuntu Linux

SuSE Linux

Back to the top