Skip to content

Instantly share code, notes, and snippets.

@konstruktoid
Last active November 9, 2022 17:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save konstruktoid/1bc96c4f5030f37bd5f5142cc2718b35 to your computer and use it in GitHub Desktop.
Save konstruktoid/1bc96c4f5030f37bd5f5142cc2718b35 to your computer and use it in GitHub Desktop.
$ cat /etc/systemd/system/jenkins.service
[Unit]
Description=Jenkins - open source automation server
Before=multi-user.target
After=network-online.target
[Service]
ExecStart=/etc/init.d/jenkins start
ExecStop=/etc/init.d/jenkins stop
CapabilityBoundingSet=~CAP_SYS_PTRACE
GuessMainPID=no
IgnoreSIGPIPE=no
KillMode=process
LimitNOFILE=64000
LimitNPROC=64000
ProtectHome=true
ProtectSystem=full
RemainAfterExit=yes
TimeoutSec=5min
Type=oneshot
$ grep KillExcludeUsers /etc/systemd/logind.conf
KillExcludeUsers=root jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment