Skip to content

Instantly share code, notes, and snippets.

@manjeshpv
Created April 18, 2016 12:22
Show Gist options
  • Save manjeshpv/387a4284e05aa5d2fcaa855ed525b31b to your computer and use it in GitHub Desktop.
Save manjeshpv/387a4284e05aa5d2fcaa855ed525b31b to your computer and use it in GitHub Desktop.
Systemd service for go and nodejs
# go
[Unit]
Description=Beatle
After=syslog.target
[Service]
WorkingDirectory=/root/go/bin
ExecStart=/root/go/bin/hello
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=beatle
User=root
Group=root
EnvironmentFile=/etc/beatle.env
[Install]
WantedBy=multi-user.target
# nodejs
[Unit]
Description=<Project Name>
After=syslog.target
[Service]
WorkingDirectory=/var/www
ExecStart=/usr/local/bin/node server/index
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=<project-name>
User=root
Group=root
EnvironmentFile=/var/env/<project-name>.env
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment