Last active
September 25, 2017 14:13
-
-
Save ttencate/6b36904fc884f02e3ca0972824cfa724 to your computer and use it in GitHub Desktop.
Alakajam systemd unit
This file contains 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
# Usage: | |
# - Put this content into /etc/systemd/system/alakajam.service | |
# - systemctl enable alakajam | |
# - systemctl start alakajam (or systemctl restart apache) | |
[Unit] | |
Description=Alakajam server | |
Requires=network.target | |
After=network.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/var/www/alakajam # path to git repo | |
ExecStart=/usr/bin/node server.js # assuming node is /usr/bin/node, adjust accordingly | |
User=nobody # or some other user, best not root | |
Group=nobody # or some other group, best not root | |
Restart=on-failure | |
[Install] | |
WantedBy=apache.service # I'm assuming that's what it's called; do "systemctl | grep apache" to make sure) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment