Running Jenkins slave via systemd

1,529 views
Skip to first unread message

Yarden Bar

unread,
Dec 26, 2015, 2:26:04 AM12/26/15
to Jenkins Users
Hi all,
I'm using this forked Puppet module to configure a Jenkins slave instance.

The systemd Unit script doesn't start the process. If I su to root, source the /etc/sysconfig/jenkins-slave file and run the start-stop-daemon command as-is, the slave starts and connects to the master.

Any idea?

Thanks in advance,
Yarden

Michael Neale

unread,
Dec 28, 2015, 6:34:36 PM12/28/15
to Jenkins Users
Hi Yarden. 

I had a systemd script I used for "OPE" style slaves (which are basically jnlp slaves): https://gist.github.com/michaelneale/9635744

(a bit more written about it here), it worked for me as I learned systemd, may be able to adapt it: http://documentation.cloudbees.com/docs/dev-at-cloud/On-Premise+Executors.html?query=systemd#running-the-slave-with-systemd-on-linux

Yarden Bar

unread,
Jan 3, 2016, 5:19:21 AM1/3/16
to Jenkins Users
Hi Michael,
(I was OOO for the past week)

Regarding the systemd script, I see that it doesn't make use of the EnvironmentFile property.
I've managed to successfully start the slave process only by hard-coding parameters into to the java command. whenever I tried using env vars from the '/etc/sysconfig/jenkins-slave' the process failed to start.


Any idea on that?

Thanks,
Yarden

Michael Neale

unread,
Jan 6, 2016, 11:29:24 PM1/6/16
to Jenkins Users
Hi Yarden. 

No reason I didn't use it, just a) didn't know about it and b) probably didn't think to look. at the time I found systemd rather frustrating to diagnose so keeping the directives used fairly minimal worked for me (this was quite a few years ago when systemd was still a bit controversial).

When you say hard coding, do you mean you are setting the vars are part of the ExecStart line? Perhaps if you could gist your config (the one that works and the one that doesn't work) may make things clearer. 

Thanks!
Reply all
Reply to author
Forward
0 new messages