Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"monit reload" does not completely register new services #9

Open
hiyer opened this issue Dec 15, 2017 · 1 comment
Open

"monit reload" does not completely register new services #9

hiyer opened this issue Dec 15, 2017 · 1 comment

Comments

@hiyer
Copy link

hiyer commented Dec 15, 2017

This might be the expected behaviour, but I thought I'd check here just in case it isn't.
Steps to reproduce:

  1. Add a new config file to monit, e.g in /etc/monit.d
  2. Run monit -v reload. Verify that your new service shows up in the service list. e.g.
Process Name          = diskchecker3
 Pid file             = /media/ephemeral0/logs/others/disk_check_daemon.pid
 Monitoring mode      = active
 Start program        = 'redacted' as uid 0 as gid 0 timeout 30 second(s)
 Stop program         = 'redacted' as uid 0 as gid 0 timeout 30 second(s)
 Existence            = if does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
 Pid                  = if changed 1 times within 1 cycle(s) then alert
 Ppid                 = if changed 1 times within 1 cycle(s) then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor
  1. Try to start this service with monit -v start diskchecker3. This will fail with the following error:
-------------------------------------------------------------------------------
monit: action failed -- There is no service by that name
-------------------------------------------------------------------------------
    monit() [0x40f728]
    monit(LogError+0xa0) [0x40fda0]
    monit(control_service_daemon+0x29d) [0x40b20d]
    monit(main+0x644) [0x409ac4]
    /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fb535693c05]
    monit() [0x40a019]
-------------------------------------------------------------------------------
  1. Run kill -SIGUSR1 $(pidof monit) and then try restarting the service again. This will succeed.

Invoking service monitor restart instead of monit reload will also register the service for start. So my questions are:

  1. What do service start/SIGUSR1 do that reload doesn't?
  2. What is the recommended way to add a new service to a running instance of monit, if any?
@arhsimluhar
Copy link

arhsimluhar commented Mar 12, 2018

Saw this happening in my case, saw two monit processes running.Kill other instances and you are good to go. Solve my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants