From owner-freebsd-hackers Fri Feb 6 11:14:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA06110 for hackers-outgoing; Fri, 6 Feb 1998 11:14:56 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from callisto.fortean.com (callisto.fortean.com [209.42.194.97]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA06086 for ; Fri, 6 Feb 1998 11:14:43 -0800 (PST) (envelope-from walter@fortean.com) Received: from localhost (walter@localhost) by callisto.fortean.com (8.8.8/8.8.5) with SMTP id OAA00392; Fri, 6 Feb 1998 14:14:06 -0500 (EST) X-Authentication-Warning: callisto.fortean.com: walter owned process doing -bs Date: Fri, 6 Feb 1998 14:14:06 -0500 (EST) From: "Bruce M. Walter" To: Tom cc: Terry Lambert , John Fieber , calin@ibd.dbio.ro, freebsd-hackers@FreeBSD.ORG Subject: Re: Powering off the system/UPS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" > 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! || ========================================================================