My home server is attached to a APC Back-UPS ES 600G. This one got a fixed grace time of 20 seconds, i.e., after it received the power down command from sysutils/apcupsd, the server has less than 20 seconds left for regularly shutting down. For 8.x and 9.x this has always been sufficient.
Since upgrading to FreeBSD RELEASE-10.1, the shutdown sequence occasionally takes much longer than 20 s. This happens also when I do a manual
The time it takes for shutting down the machine seems to be related to the power-on time. If the server is running more than a week, then shutting it down may take a minute. Unfortunately, I cannot change the grace time of the UPS.
Presently, apcupsd is configured in standard mode: --kill-on-powerfail. That means, shutting down of all the running daemons and then synching the disks must be finished within 20 seconds. I guess, I am looking for a way of telling apcupsd to send the --killpower command only after shutting down of the daemons has been finished, just before synching the disks.
I read the apcupsd manual and the respective man pages, and it seems that this could be achieved somehow -- from: apcupsd.conf(5):
However, I set the KILLDELAY to 120 s, ran the full power down test, and KILLDELAY didn't make any difference. I must be missing something, and the question is, what am I missing?
Since upgrading to FreeBSD RELEASE-10.1, the shutdown sequence occasionally takes much longer than 20 s. This happens also when I do a manual
shutdown -r now. In case of a shutdown initiated by the UPS, this means that the server is turned off before the disks are synched. Today, I experienced another power loss, and it happened again that the server was turned off before the regular shutdown sequence was finished. The postgresql databases were left in a dirty state, and the disks were not synched.The time it takes for shutting down the machine seems to be related to the power-on time. If the server is running more than a week, then shutting it down may take a minute. Unfortunately, I cannot change the grace time of the UPS.
Presently, apcupsd is configured in standard mode: --kill-on-powerfail. That means, shutting down of all the running daemons and then synching the disks must be finished within 20 seconds. I guess, I am looking for a way of telling apcupsd to send the --killpower command only after shutting down of the daemons has been finished, just before synching the disks.
I read the apcupsd manual and the respective man pages, and it seems that this could be achieved somehow -- from: apcupsd.conf(5):
KILLDELAY <seconds>
Specifies the number of seconds for which apcupsd will continue
running after a shutdown has been requested. After the specified
time, apcupsd will attempt to put the UPS into hibernate mode
and kill the power to the computer. This is for use on operating
systems where apcupsd cannot regain control after a shutdown (eg
FreeBSD) to issue an apcupsd --killpower command. Setting the
delay to 0 disables it.
However, I set the KILLDELAY to 120 s, ran the full power down test, and KILLDELAY didn't make any difference. I must be missing something, and the question is, what am I missing?