Table of Contents

Cheatsheet for Systemd

Typical Service File

/etc/systemd/system/orzbot.service
[Unit]
Description=orzBot
After=network.target
 
[Service]
User=orzbot
Group=orzbot
SyslogIdentifier=orzbot.service
ExecStart=/home/orzbot/.nvm/nvm-exec node /home/orzbot/orzbot/app.js
WorkingDirectory=/home/orzbot/orzbot
Environment=ORZBOT_TOKEN=ventuaeiornuvyiopwefuvgyu
Environment=NODE_VERSION=8.1.0
Restart=always
RestartSec=5s
KillSignal=SIGINT
TimeoutStartSec=10
TimeoutStopSec=120
 
[Install]
WantedBy=multi-user.target

Commands

(disclaimer for grep: has better way, but hard to remember)

See Alsos