Automatically starting dependent services

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
dan
Reply | Threaded
Open this post in threaded view
|

Automatically starting dependent services

dan
Issue #248 reversed a bug which I would actually have found useful to
remain in the code!

When a service is started, any dependent services are no longer started.
I can see that this is the correct behaviour most of the time.

However, we sometimes have "helper" services, hanging off a main
service, which everyone forgets about. They stop the main service with
the client "monit stop main-service", fix this or that, and turn the
main service back on again "monit start main-service" and forget that
the helpers would now be stopped.

In this case auto-starting of dependents would be great. I'm considering
writing a patch which adds syntax into the dependency line "with
autostart", or somesuch, which re-enables this propagation for those
dependencies.

Before I do so, is this a good idea? Is there some cunning method of
getting this behaviour already such that a patch is not required? Any
general guidelines for a newbie to the monit source for conditionally
reversing #248?

At the moment we have to restart all to make sure everything is running,
which isn't ideal as it's not symmetrical and maybe all slightly too
many services? Also alerts help, but not getting into an alerting
situation is better!

Thanks,
Dan.

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Automatically starting dependent services

martinp@tildeslash.com
Hi,

i think it will be better to put the whole dependency group into one service group, for example:

        check process A with pidfile ...
                group mycluster

        check process B with pidfile ...
                group mycluster
                depends on A

        check process C with pidfile ...
                group mycluster
                depends on A

Now you can start/stop/restart the whole group (monit will handle the dependencies):

        monit -g mycluster stop
        monit -g mycluster start

Best regards,
Martin


> On 31 Mar 2017, at 18:00, dan <[hidden email]> wrote:
>
> Issue #248 reversed a bug which I would actually have found useful to
> remain in the code!
>
> When a service is started, any dependent services are no longer started.
> I can see that this is the correct behaviour most of the time.
>
> However, we sometimes have "helper" services, hanging off a main
> service, which everyone forgets about. They stop the main service with
> the client "monit stop main-service", fix this or that, and turn the
> main service back on again "monit start main-service" and forget that
> the helpers would now be stopped.
>
> In this case auto-starting of dependents would be great. I'm considering
> writing a patch which adds syntax into the dependency line "with
> autostart", or somesuch, which re-enables this propagation for those
> dependencies.
>
> Before I do so, is this a good idea? Is there some cunning method of
> getting this behaviour already such that a patch is not required? Any
> general guidelines for a newbie to the monit source for conditionally
> reversing #248?
>
> At the moment we have to restart all to make sure everything is running,
> which isn't ideal as it's not symmetrical and maybe all slightly too
> many services? Also alerts help, but not getting into an alerting
> situation is better!
>
> Thanks,
> Dan.
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general