1

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 ?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
chubbyk
  • 863
  • 2
  • 10
  • 15

3 Answers3

1

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.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
0

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.

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
-1

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.

Kan
  • 29
  • 1
  • 4