notes/ubuntu/systemd.md
Paul Trowbridge 9f99de4c66 add notes
2019-03-30 02:28:55 -04:00

477 B

save in //etc/systemd/system/this_file.service

[Unit]
Description=Redis persistent key-value database
After=network.target

[Service]
ExecStart=/usr/bin/node //var/wwww/forecast_api/index.js
User=fc
Restart=always
StandardOutput=syslog
StandardError=syslog
WorkingDirectory=//var/www/forecast_api

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload

sudo systemctl enable forecast_api

https://www.axllent.org/docs/view/nodejs-service-with-systemd/