Skip to content

Instantly share code, notes, and snippets.

@rluisr
Created January 25, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rluisr/887c59c8f70b96a01a722bce7be869dc to your computer and use it in GitHub Desktop.
Save rluisr/887c59c8f70b96a01a722bce7be869dc to your computer and use it in GitHub Desktop.
Add service as systemd
[Unit]
Description=Run API program as node user on boot
[Service]
Type=simple
RemainAfterExit=yes
User=node
ExecStart=/usr/bin/forever start /home/node/Web-API/app.js
ExecStop=/usr/bin/forever stop /home/node/Web-API/app.js
ExecReload=/usr/bin/forever restart /home/node/Web-API/app.js
Restart=always
KillMode=process
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment