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 ?

link|improve this question

10% accept rate
feedback

3 Answers

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

This is a little hackish, but it worked for me.

  1. stop monit (/etc/init.d/monit stop)
  2. start monit using this command (/usr/bin/monit -c /etc/monit.conf -l /var/log/monit.log -vv)
  3. test status (/etc/init.d/monit status)
    No subsys locked error is reported.

use /usr/bin/monit -h for more monit options.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.