Created
September 1, 2016 16:22
-
-
Save ffflorian/a67605537a20b701a9d9f62f7d031da0 to your computer and use it in GitHub Desktop.
Example systemd service for a node.js app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create at /etc/systemd/system/ or ~/.config/systemd/user/ | |
# Enable with systemctl enable appname.service | |
# Start with systemctl start appname.service | |
[Unit] | |
Description=Appname | |
# wait for network | |
After=network.target | |
[Service] | |
User=node | |
ExecStart=/usr/bin/node /opt/node/appname/index.js | |
Restart=on-failure | |
RestartSec=10 | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=appname-node | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment