Skip to content

Instantly share code, notes, and snippets.

@mche
Last active November 13, 2017 12:01
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 mche/8e04aaae25aa1bdb696cade61166cf3d to your computer and use it in GitHub Desktop.
Save mche/8e04aaae25aa1bdb696cade61166cf3d to your computer and use it in GitHub Desktop.
systemd for hypnotoad perl Mojolicious
[Unit]
Description=Mojolicious hypnotoad
After=postgresql.service
[Service]
Type=forking
PIDFile=/home/guest/hypnotoad.pid
WorkingDirectory=/home/guest
#User=
#Group=
Environment=
#OOMScoreAdjust=-200
ExecStart=/bin/su -c 'perlbrew use perl-5.26.1 && hypnotoad script.pl ' - guest
ExecStop=/bin/su -c 'perlbrew use perl-5.26.1 && hypnotoad -s script.pl ' - guest
ExecReload=/bin/su -c 'perlbrew use perl-5.26.1 && hypnotoad script.pl ' - guest
#ExecReload=/bin/kill -USR2 $PIDFile
TimeoutSec=120
#Restart=always
#RemainAfterExit=on
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment