Have trouble with monit (monit dead but subsys locked)


I installed monit on my centos 6/64bit and somethings wrong. Look at the shell :

[root@ND-1003 monit.d]# service monit start
Starting monit: monit: generated unique Monit id f8f62f27db2323649f105342f2fbf04d and stored to '/var/monit/id'
                                                           [  OK  ]
[root@ND-1003 monit.d]# service monit status
monit dead but subsys locked
[root@ND-1003 monit.d]# service monit stop
Stopping monit:                                            [FAILED]

As you can see there is a message: monit dead but subsys locked

Anybody know how to correct this ?

Best Answer

Look for the monit statefile variable in the configuration file. On the CentOS/RHEL RPMForge packaging of monit, the statefile defaults to /var/monit/state

The definition in the config file looks like:

set statefile /var/monit/state

Find the file, remove it, then restart the monit service.