Skip to content

Instantly share code, notes, and snippets.

@teward
Last active March 19, 2019 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teward/ba5d194d95fdfead98d2d2ee5a9d2887 to your computer and use it in GitHub Desktop.
Save teward/ba5d194d95fdfead98d2d2ee5a9d2887 to your computer and use it in GitHub Desktop.
SystemD service for SmokeDetector
# To be put into /etc/systemd/system/... or similar location for SystemD units.
[Unit]
Description=SmokeDetector StackOverflow Anti-Spam ChatBot
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/path/to/SmokeDetector/nocrash.py standby
Type=simple
User=USERTORUNAS
Group=GROUPTORUNAS
WorkingDirectory=/path/to/SmokeDetector
# Make sure the directory here is created with the seame ownership rights that user/group specify!
StandardOutput=file:/var/log/smokedetector/output.log
StandardError=file:/var/log/smokedetector/error.log
Restart=on-failure
RestartSec=10s
SuccessExitStatus=SIGINT SIGKILL
RestartPreventExitStatus=SIGINT SIGKILL
[Install]
WantedBy=multi-user.target
Alias=smokey.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment