Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 1998 14:14:06 -0500 (EST)
From:      "Bruce M. Walter" <walter@fortean.com>
To:        Tom <tom@sdf.com>
Cc:        Terry Lambert <tlambert@primenet.com>, John Fieber <jfieber@indiana.edu>, calin@ibd.dbio.ro, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Powering off the system/UPS
Message-ID:  <Pine.BSF.3.95q.980206140354.365A-100000@callisto.fortean.com>
In-Reply-To: <Pine.BSF.3.95q.980206102658.7371A-100000@misery.sdf.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>   Not even an issue.  You want to start the shutdown well in advance
> anyhow, because battery life is a bit variable.
> 
>   The biggest problem is that a usermode program loses control as soon as
> it halts the system.  What happens if power is resumed?  The system is
> limbo with "Press any key to reboot" on the screen.  A smarter UPS can
> help, but adding intelligence to the OS is easier.

This is true.  What we've been looking at is a combination of a userland
monitor daemon and a device driver which is customizable for different
cables and UPS capabilities.  The driver handles the low-level
communication with the UPS and provides status information to the user
daemon.  It also installs a poweroff callback to shutdown the UPS inverter
if:

1) the kernel calls the poweroff callback with the RB_POWEROFF flag set in
howto -and-

2) the UPS is in line fail mode

If the power is restored after the reboot begins, the kernel will
fallthrough to the RB_AUTOBOOT code (as long as we remove the silly logic
from reboot(8) which sets RB_HALT if RB_POWEROFF is set by the -p
option...  RB_HALT should be set if reboot(8) is called as halt(8) ONLY.
They're the same program, after all ;)  A -p (poweroff) options should
also probably be added to shutdown (I'm working on most of this).

If the system reboots and the line is in failure mode, the driver can go
into a loop: 'Give me power or give me death' before the filesystems are
mounted.

- Bruce

========================================================================
|| Bruce M. Walter                    || 107 Timber Hollow Court #335 ||
|| Senior Network Consultant          || Chapel Hill, NC  27514       ||
|| Fortean Technologies, Inc.         || Tel: 919-967-4766            ||
|| Information Technology Consultants || Fax: 919-967-4395            ||  
========================================================================
||       BSD Unix -- It's not just a job, it's a way of life!         ||
========================================================================




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.980206140354.365A-100000>