-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Introduce optional sd_notify()
support for READY, RELOADING and STOPPING states, and a WATCHDOG (if enabled)
#1777
Conversation
Nice, status messages work - as well as MAINPID setting for systemd to monitor the intended upsd/upsmon/driver process after all the forking involved in starting one:
A call to |
…onally integrate with sd_notify() [networkupstools#1590]
…rvice.in: provide an Alias for convenience (upsd, upsmon)
…r upsd, upsmon and drivers [networkupstools#1590]
… if "WATCHDOG_PID" mismatches [networkupstools#1590]
…rvice.in: use Restart=on-failure so that clean intentional exit (e.g. by signal handling) does not revive it [networkupstools#1781]
…if available after reporting MAINPID to systemd [networkupstools#1590]
…t-posting the pings if expected PID is not ours [networkupstools#1590]
…psnotify_reported_watchdog_systemd hush-flag when troubleshooting [networkupstools#1590]
…itor.service.in: provide an Alias for convenience (upsd, upsmon)
Fixed watchdog integration per comments from @poettering and rebased over recent master branch. Hopefully this burst of activity is done :) |
… of got_monoclock in upsnotify() [networkupstools#1777 follow-up] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#1777 follow-up] Signed-off-by: Jim Klimov <[email protected]>
…rkupstools#2007, networkupstools#1777] Signed-off-by: Jim Klimov <[email protected]>
… of got_monoclock in upsnotify() [networkupstools#1777 follow-up] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…etworkupstools#1777 follow-up] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…rkupstools#2007, networkupstools#1777] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
Closes: #1590
While the systemd notifications are first/primary cause of this change, I tried to implement it in a somewhat abstract manner to allow easy extension to other service management frameworks. No strong opinion yet if this should supplant existing (currently nearby)
upslogx()
orupsdebugx()
messages about the lifecycle milestones.While the watchdog notification support was added, it is currently not configured by the service unit templates (something to do more exploration about to provide decent timeouts, even for busy systems). One idea for the future was to use
WATCHDOG_USEC=<NUM>
(andEXTEND_TIMEOUT_USEC=<NUM>
) messages for drivers (daemons) to actually tell systemd that they want to be watchdogged, e.g. based on optionalmaxstartdelay
setting parsed fromups.conf
. For example, full SNMP walks can take a while, tens of seconds or more, and wall-clock times depend on stress and performance of both the monitoring system and UPS interface hardware.Other NUT units, such as NDE script's service (and related path), are not covered by this change at this time.
Loosely related to #1771 (might conflict a bit). Not sure if this general daemon lifecycle notification support should also get peppered into drivers as thoroughly (e.g. track reconnection attempts as a "reloading" state).
CC @bigon