0

How could I check python daemon process? I'm trying

check process rane
        matching "147684802"
        start program = "/usr/local/bin/python2.7 /root/rane.py 147684802 > /dev/null 2>&1 &"

But it fails with timeout for my daemon-python case. Thanks!

user2298956
  • 75
  • 2
  • 10

1 Answers1

1

Monit executes the program directly - not using shell, if the program doesn't daemonize itself, you need to wrap it like this:

start program = "/bin/bash -c '/usr/local/bin/python2.7 /root/rane.py 147684802 &'"

user2298956
  • 75
  • 2
  • 10
  • This didn't work at all for me. When executing that in the terminal, it works until I disconnect from the SSH session, then it dies. When giving it to monit, it mysteriously summoned a ton of zombie processes and gave up. – Hubro Sep 01 '16 at 21:20