Skip to content

Instantly share code, notes, and snippets.

@shahzaibalikhan
Forked from DeadAlready/fooapp.service
Created May 2, 2016 21:04
Show Gist options
  • Save shahzaibalikhan/6d7dc4de50fb2840d8f6380e25fff4ea to your computer and use it in GitHub Desktop.
Save shahzaibalikhan/6d7dc4de50fb2840d8f6380e25fff4ea to your computer and use it in GitHub Desktop.
Systemd configuration file
[Unit]
Description=Our cool Node.js App
After=network.target
[Service]
Type=forking
Restart=always
User=fooapp
ExecStart=/var/appdata/fooapp/node_modules/pm2/bin/pm2 start /var/appdata/fooapp/app.js
ExecStop=/var/appdata/fooapp/node_modules/pm2/bin/pm2 stop /var/appdata/fooapp/app.js
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment