Last active
December 14, 2015 00:02
-
-
Save bcomnes/4d36e643672cbc2c346d to your computer and use it in GitHub Desktop.
Example node systemd service
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
| # Put in /etc/systemd/system or ~/.config/systemd/user/ if running with --user flag | |
| [Unit] | |
| Description=Example Node Systemd Service | |
| [Service] | |
| ExecStart=/usr/local/bin/node /home/project-folder/server.js | |
| Restart=always | |
| StandardOutput=syslog | |
| SyslogIdentifier=logid | |
| Environment=NODE_ENV=production PORT=80 | |
| # uncomment and set user to run service as a different use than root | |
| #User=<username to run as> | |
| [Exec] | |
| RootDirectory=/home/project-folder | |
| [Install] | |
| WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment