Don't check for zmdc.pl when stopping via systemd

If this check ever actually returns true, it makes ExecStop a no-op
and systemd will forcefully kill all processes in the service
see man systemd.service

This also prevents a deadlock when running systemctl stop,
zmpkg.pl detects bash as it's parent and attempts to call
systemctl stop itself, which blocks forever waiting for the
task it's in to complete
This commit is contained in:
Andrew Cook 2014-12-23 20:25:55 +11:00
parent 1131809c92
commit c69badc70d
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ User=www-data
Type=forking Type=forking
ExecStart=/usr/bin/zmpkg.pl start ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.pl stop' ExecStop=/usr/bin/zmpkg.pl stop
PIDFile=/var/run/zm/zm.pid PIDFile=/var/run/zm/zm.pid
[Install] [Install]