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 ?
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.
If you look in the startup script, is there a lockfile or socket file that is searched for in a tmp directory of some kind? Rename that and see if it'll start.
Might be in something like /var/lock/subsys or /var/run.
This is a little hackish, but it worked for me.
/etc/init.d/monit stop
)/usr/bin/monit -c /etc/monit.conf -l /var/log/monit.log -vv
)/etc/init.d/monit status
)No subsys locked error is reported.
use
/usr/bin/monit -h
for more monit options.