ICTO / ansible-jenkins

Ansible playbook: Jenkins
MIT License
282 stars 172 forks source link

Systemd service file #55

Open takluyver opened 7 years ago

takluyver commented 7 years ago

I had some trouble running Jenkins under Ubuntu 16.04 with systemd. This seems to have been resolved by creating a systemd service file at /etc/systemd/system/jenkins.service:

[Unit]
Description=Jenkins Daemon

[Service]
Environment="JENKINS_HOME=/var/lib/jenkins"
ExecStart=/usr/bin/java -jar /usr/share/jenkins/jenkins.war
User=jenkins

[Install]
WantedBy=multi-user.target

(This is cobbled together and there may well be some extra bits needed, but it seems to be working for me)