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