Skip to content

Instantly share code, notes, and snippets.

@beingadityak
Created November 22, 2020 10:12
Show Gist options
  • Save beingadityak/ab2e46988cccc0a5e6dd289065551d8d to your computer and use it in GitHub Desktop.
Save beingadityak/ab2e46988cccc0a5e6dd289065551d8d to your computer and use it in GitHub Desktop.
TLDR instructions and template - SystemD service
[Unit]
Description=My awesome webapp
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/var/www/webapp.bin
[Install]
WantedBy=multi-user.target

Instructions for modifying and using the service

  1. Modify the Description, ExecStart fields for your application.
  2. Place the file in /lib/systemd/system/ with .service extension. Eg. /lib/systemd/system/example-webapp.service
  3. Perform a daemon-relaod systemctl daemon-reload and the start the service with systemctl start example-webapp0.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment