monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Request for comments: Service startup/monitoring mode changes


From: Guillaume François
Subject: Re: Request for comments: Service startup/monitoring mode changes
Date: Fri, 6 May 2016 15:09:07 +0200

Hello,

In fact, it could be still a bit confusing with the current keyword especially with the "mode".

Instead of  mode <auto | noauto | adaptive > maybe the following is more explicit onreboot < start | nostart | laststate >

Having a new keyword could brake configuration backward compatibility but possible workaround is to support both (if feasible), with their own original behavior having the old one being deprecated. Obviously in that case specifying both keyword is forbidden.

How to you plan to advertise user of the new configuration keywords ? I never encountered someone using monit as init process (pid 0) but breaking legacy behavior could harm them.

Best Regards,


2016-05-06 14:38 GMT+02:00 Martin Pala <address@hidden>:
Hi all,

we'd like to know what you think about the change of the "mode" statement implementation, which we plan to do in monit 5.18 to make the startup modes easier to understand.

Current implementation:
####################

In the current implementation, the service monitoring state is always persistent across reboot, i.e. if you do "monit stop <service>" (or unmonitor), it remains stopped/unmonitored after reboot too. If you want to enable it again, you have to do "monit start <service>".

This behaviour is confusing for some users, as it is different from common service control frameworks like SysVinit rc scripts, Upstart and Systemd, which start services automatically after system reboot.

If user wanted to have automatic startup regardless of a service state before reboot, it was recommended to either place the monit state file to a volatile filesystem, or add "monit monitor all" to the monit start script.

Current syntax:

mode <active | passive | manual>

The difference between these modes is currently minimal, the last service state (started or stopped) is always persistent state across reboot.


Proposed modification:
####################

New syntax:

mode <auto | noauto | adaptive>

Where:
auto = always start automatically after reboot
noauto = never start automatically after reboot
adaptive = restore the same state the service had before reboot

Details:

active (last state persistent across reboot) -> auto (always start after reboot; DEFAULT mode):
"active" will be renamed to "auto" and the mode will NOT be persistent across reboot. If you stop a service and reboot the machine, the service will be started automatically after reboot.

manual (last state persistent across reboot) -> noauto (always stopped after reboot):
This mode is an antonym of "auto" - the service should NEVER start automatically after reboot. This mode is intended for a high-availability solutions with active/passive clusters. For example: the service group HA is started on
machine M1, the machine M2 is backup, heartbeat is in place between both machines. The service group HA (such as an mobile IP alias + application server). must be started on one node only. When M1 dies, M2 takes HA group over,
but if M1 reboots, it is important that it won't try to start the HA group too (even though it was active on M1 before it crashed), as HA is running on M2 now.

adaptive (new):
An adaptive mode, which is PERSISTENT across reboot, based on the last service state (i.e. stopped before reboot => stopped after reboot too; monitored before reboot => monitored after reboot too)

passive (obsolete):
Will be obsolete (but still supported for backward compatibility). Long time ago, there was no "if does not exist then <action>" statement, so if the user wanted to receive just alerts if the process died and to have
  start+stop programs in the service configuration, the "mode passive" allowed to override restart action and alert only. With presence of "if does not exist" statement it's no longer necessary.


Alternative mode names:

"noauto" ... maybe keep current name?: "manual"
"adaptive" ... maybe call it "persistent"?



Thanks for your feedback, enjoy the weekend,

Best regards from the Monit team :)



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



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]