Skip to content

Instantly share code, notes, and snippets.

@rabin-io
Last active December 9, 2021 09:21
Show Gist options
  • Save rabin-io/b95fdb8706e5fb26ff399e199471385e to your computer and use it in GitHub Desktop.
Save rabin-io/b95fdb8706e5fb26ff399e199471385e to your computer and use it in GitHub Desktop.
Jenkins systemd service unit file
# /etc/systemd/system/jenkins.service
[Unit]
Description=Standalone Jenkins Master server
Documentation=https://www.jenkins.io/doc
Wants=network-online.target
After=network-online.target
[Service]
User=jenkins
Group=jenkins
Environment=HTTP_PORT=8080
Environment=JAVA_ARGS=-Djava.awt.headless=true
Environment=JENKINS_HOME=/var/lib/jenkins
Environment=JENKINS_WAR=/usr/lib/jenkins/jenkins.war
Environment=LISTEN_ADDRESS=127.0.0.1
Environment=WEBROOT=/var/cache/jenkins/war
WorkingDirectory=/var/lib/jenkins
LimitNOFILE=8192
ExecStart=/usr/bin/java ${JAVA_ARGS} -jar ${JENKINS_WAR} --webroot=${WEBROOT} --httpPort=${HTTP_PORT} --httpListenAddress=${LISTEN_ADDRESS}
[Install]
WantedBy=multi-user.target
@serbaniuliuscezar
Copy link

Thanks, this helped a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment