[unit] Description=Node.js Sugarizer Server Requires=After=mongodb.service # Requires the mongodb service to run first [Service] WorkingDirectory={{ sugarizer_location }}/sugarizer/server/ ExecStart=/usr/bin/node sugarizer.js Restart=always RestartSec=10 # Restart service after 10 seconds if node service crashes StandardOutput=syslog # Output to syslog StandardError=syslog # Output to syslog SyslogIdentifier=sugarizer #User= #Group= Environment=NODE_ENV=production [Install] WantedBy=multi-user.target