Skip to content

Instantly share code, notes, and snippets.

@lrstanley
Created March 25, 2019 01:47
Show Gist options
  • Save lrstanley/5ba00076899bc1b563e2e0a0269e8efa to your computer and use it in GitHub Desktop.
Save lrstanley/5ba00076899bc1b563e2e0a0269e8efa to your computer and use it in GitHub Desktop.
example simple systemd file (go sites?)
; can go in /etc/systemd/system/mysite.service
; make sure to:
; $ systemctl enable <app>
; $ systemctl start <app>
[Unit]
Description=mysite
Wants=network-online.target
After=network-online.target
[Service]
;PIDFile=/tmp/mysite.pid
ExecStart=/opt/yoursite/yourbinary <args>
WorkingDirectory=/opt/yoursite/
LimitNOFILE=4096
User=root
Group=root
Restart=always
RestartSec=10
StartLimitInterval=0
TimeoutStopSec=10s
KillMode=mixed
KillSignal=SIGQUIT
;PrivateDevices=true
;ProtectHome=true
;ProtectSystem=full
;PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment