Skip to content

Instantly share code, notes, and snippets.

@ttencate
Last active Sep 25, 2017
Embed
What would you like to do?
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