Linux – Monit wont start/stop any processes

linuxmonit

I've got monit running on a linux vserver, installed in a custom location

/home/user/bin/monit

as that is the only suitable location according to the webhost providers. When I installed monit I used ./configure –prefix=/home/user

Monit itself runs, and sends me emails of it's activity, and the control file syntax is correct. However, monit cannot seem to start or stop anything – or even run the simplest of scripts. eg. Using 'monit stop all', I try to run the following stop command

stop = "/bin/bash /home/user/simple_script.sh"

Which fails (and says so in the log). I cant figure out why this is failing, can anyone help with this?

Best Answer

We use monit talso, and we have something like that in our scripts:

check process cron with pidfile /var/run/crond.pid
    start program = "/etc/init.d/cron start"
    stop  program = "/etc/init.d/cron stop"
    group system
    depends cron_init, cron_bin

check file cron_init with path /etc/init.d/cron
    group system

check file cron_bin with path /usr/sbin/cron
    group system

Can you show us monit logs?

Related Topic