Skip to content

Instantly share code, notes, and snippets.

@slashdevsda
Created June 25, 2013 12:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save slashdevsda/5858233 to your computer and use it in GitHub Desktop.
Save slashdevsda/5858233 to your computer and use it in GitHub Desktop.
basic systemd unit for nodeJS, using forever. with mongodb dep.
[Unit]
Description=Start Node.js Service
Requires=network.target mongodb.service
After=network.target
[Service]
Type=forking
WorkingDirectory=/srv/node/
ExecStart=/usr/bin/forever start --pidFile /srv/node/nodeserialskiller.pid /srv/node/server.js
ExecStop=/usr/bin/forever stop /srv/node/server.js
PIDFile=/srv/node/nodeserialskiller.pid
User=nodejs
Group=nodejs
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment