Skip to content

Instantly share code, notes, and snippets.

@ttencate
Last active September 25, 2017 14:13
Show Gist options
  • Save ttencate/6b36904fc884f02e3ca0972824cfa724 to your computer and use it in GitHub Desktop.
Save ttencate/6b36904fc884f02e3ca0972824cfa724 to your computer and use it in GitHub Desktop.
Alakajam systemd unit
# 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