Skip to content

Instantly share code, notes, and snippets.

@Hoto-Cocoa
Forked from perillamint/node.service
Last active February 23, 2017 21:22
Show Gist options
  • Save Hoto-Cocoa/d95c4624081be20a77e6b781e508b928 to your computer and use it in GitHub Desktop.
Save Hoto-Cocoa/d95c4624081be20a77e6b781e508b928 to your computer and use it in GitHub Desktop.
/etc/systemd/system/node.service
[Unit]
Description=Node Application
After=network.target
[Service]
WorkingDirectory=/root/path/
ExecStart=/usr/bin/node /root/path/index.js >> /root/path/runtime.log
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodeapp
User=root
Group=root
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment