jenkins the definitive guide

(Jeff_L) #1

Figure 11.12. Installing the Jenkins slave as a Windows service


Once this is done, your Jenkins slave node will start automatically whenever the machine starts up,
and can be administered just like any other Windows service (see Figure 11.13, “Managing the Jenkins
Windows service”).


Figure 11.13. Managing the Jenkins Windows service


11.3.4. Starting the Slave Node in Headless Mode


You can also start a slave agent in headless mode, directly from the command line. This is useful if
you don’t have a user interface available, for example if you are starting a JNLP slave node on a Unix
machine. If you are working with Unix machines, it is generally easier and more flexible just to use
an SSH connection, but there are sometimes network or architecture constraints that prevent you from
using SSH. In cases like this, it is still possible to run a slave node from the command line.


To start the slave node this way, you need to use Jenkins’ slave.jar file. You can find this in
JENKINS_HOME/war/WEB-INF/slave.jar. Once you have located this file and copied it onto the
Windows slave machine, you can run it as follows:


java -jar slave.jar \
-jnlpUrl http://build.myorg.com/jenkins/computer/windows-slave-1/slave-agent.jnlp

And if your Jenkins server requires authentication, just pass in the -auth username:password option:

Free download pdf