Skip to content

Instantly share code, notes, and snippets.

@desyncr
Last active April 12, 2018 15:57
Show Gist options
  • Save desyncr/8463053 to your computer and use it in GitHub Desktop.
Save desyncr/8463053 to your computer and use it in GitHub Desktop.
Monit check pid-less process (without script)
check process zmq with pidfile '/tmp/zmq.pid'
start program '/bin/bash -c "/usr/bin/php /var/www/sm/public/index.php zmq daemon execute & echo $! > /tmp/zmq.pid"'
stop program '/usr/bin/killall --full "zmq daemon execute"'
@korjavin
Copy link

Nice!

@micheldegeofroy
Copy link

Hi zmq, It seems to be a cool way to go around the pid problem with monit but being new at this I don't know how to implement in for qbittorrent-nox maybe you can help ?
this is where the file is located
nevsky@nevsky:~$ whereis qbittorrent-nox
qbittorrent-nox: /usr/bin/qbittorrent-nox /usr/bin/X11/qbittorrent-nox /usr/share/man/man1/qbittorrent-nox.1.gz

this is what I did but it failed to work

check process Qbitttorrent with pidfile '/tmp/Qbittorrent.pid'
start program '/bin/bash -c "/usr/bin/qbittorrent-nox /usr/bin/X11/qbittorrent-nox Qbittorrent daemon execute & echo $! > /tmp/Qbittorrent.pid"'
stop program '/usr/bin/killall --full "Qbittorrent daemon execute”'

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment