[Bug 237600] sysutils/apcupsd: the current shutdown procedure is unsuitable, especially for servers
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Apr 27 10:31:23 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237600
Bug ID: 237600
Summary: sysutils/apcupsd: the current shutdown procedure is
unsuitable, especially for servers
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: dbaio at freebsd.org
Reporter: vas at mpeks.tomsk.su
Flags: maintainer-feedback?(dbaio at freebsd.org)
Assignee: dbaio at freebsd.org
The default setup of the port is to run "apcupsd --kill-on-powerfail". This
means when the UPS power is exhausted, apcupsd sends a signal to the UPS to
hybernate and initiates a system shutdown. Thus the complete shutdown sequence
must fit within the UPS grace period.
While this may be tolerated on workstations, it is completely unusable on busy
servers, especially running multiple virtual machines in bhyve, because the UPS
grace period may be not long enough for all the VMs to shut down correctly.
Thus we observe a race condition and cannot predict if there will be enough
time for the daemons/VMs to stop, before the host is powered off.
Ideally, apcupsd should wait for all the shutdown scripts to complete, and only
then should it send the hybernate signal to the UPS. This means that:
1. apcupsd should be started without the --kill-on-powerfail option, perhaps
without any options at all, or with the --term-on-powerfail option. It is easy
to implement, just alter the default apcupsd_flags.
2. The "apcupsd --killpower" command should be called somewhere near the very
end of the shutdown sequence, on the condition that /var/run/powerfail exists.
I cannot currently suggest where to put "apcupsd --killpower" in
/usr/local/etc/rc.d/ so that it is executed last.
I think that the way apcupsd is run on FreeBSD should be seriously
reconsidered.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list