Search code examples
pythonmonit

Monit python daemon process


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!


Solution

  • 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 &'"