Date: Fri, 27 Sep 2002 17:14:24 +0200 From: David =?iso-8859-1?Q?Sieb=F6rger?= <drs@rucus.ru.ac.za> To: Petri Riihikallio <Petri.Riihikallio@Metis.fi> Cc: questions@FreeBSD.ORG Subject: Re: How to shut down cleanly by killing power Message-ID: <20020927151424.GA430@rucus.ru.ac.za> In-Reply-To: <a05111b01b9b9ea46ac33@[192.168.0.2]> References: <a05111b01b9b9ea46ac33@[192.168.0.2]>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri 2002-09-27 (14:00), Petri Riihikallio wrote: > Have you thought about this situation: > > 1. The UPS is almost empty, and the monitoring system issues shutdown -p > 2. The system starts the shutdown sequence. It can take well over a > minute. There is no way to stop it now. > 3. Power returns before the UPS is completely empty. > > Now the system has shut down with the -p flag, but power is > continuously available. The system won't boot automatically, no > matter what you have set up in BIOS, because the power never was down. The way I've set it up, upsmon (part of NUT) issues a 'shutdown -p' when the battery is low. A local hack to rc.shutdown then instructs the UPS to turn itself off a few seconds later, by running: /usr/local/libexec/nut/newapc -a su1000 -k -d 3 In the scenario you describe, things would work like this: - mains power fails, and the UPS runs on battery power - eventually, the battery runs low - upsmon starts the shutdown process - rc.shutdown tells the UPS to turn itself off - the PC turns itself off - some seconds later, the UPS shuts down as instructed, without draining its battery - mains power is restored - the UPS notices that power is restored, powers up again, and the PC boots There is still a short period during which deadlock could occur (between the PC shutting down and the UPS shutting down), but this is far shorter than the time between the PC shutting down and UPS draining its battery. -- David Siebörger drs@rucus.ru.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020927151424.GA430>