Skip to content

Instantly share code, notes, and snippets.

@fnzv
Created April 28, 2018 14:48
Show Gist options
  • Save fnzv/4753ec1670e594193eb12129dc48d70c to your computer and use it in GitHub Desktop.
Save fnzv/4753ec1670e594193eb12129dc48d70c to your computer and use it in GitHub Desktop.
Generic systemd unit for simple service
systemctl daemon-reload
systemctl enable generic.service
systemctl start generic.service
[Unit]
Description=My Miscellaneous Service
After=network.target
[Service]
Type=simple
User=user
WorkingDirectory=/home/ubuntu
ExecStart=mypath_to_binary
Restart=on-failure # or always, on-abort, etc
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment