roles/node_stuff/templates/node.service.j2 (view raw)
1[Unit]
2Description=A NodeJS project.
3After=syslog.target network.target
4
5[Service]
6Type=simple
7Restart=always
8RestartSec=1
9WorkingDirectory={{ repo_dir }}{{ item }}
10ExecStart=/usr/bin/npm start
11User={{ user }}
12StandardOutput=syslog
13StandardError=syslog
14SyslogIdentifier= {{ item }}
15
16[Install]
17WantedBy=multi-user.target