From owner-freebsd-hackers Sat Aug 15 02:31:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA08711 for freebsd-hackers-outgoing; Sat, 15 Aug 1998 02:31:20 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from linkdead.paranoia.com (linkdead.paranoia.com [204.145.225.245]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA08704 for ; Sat, 15 Aug 1998 02:31:13 -0700 (PDT) (envelope-from vax@linkdead.paranoia.com) Received: from localhost (localhost [127.0.0.1]) by linkdead.paranoia.com (8.8.8/8.7.3) with SMTP id EAA00661; Sat, 15 Aug 1998 04:26:38 -0500 (CDT) Message-Id: <199808150926.EAA00661@linkdead.paranoia.com> X-Authentication-Warning: linkdead.paranoia.com: localhost [127.0.0.1] didn't use HELO protocol To: netbsd-users@netbsd.org, freebsd-hackers@FreeBSD.ORG, tech@openbsd.org, linux-kernel@vger.rutgers.edu Subject: ups/power management techniques X-URI: http://www.paranoia.com/~vax Date: Sat, 15 Aug 1998 04:26:36 -0500 From: VaX#n8 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Apologies for sending to such a broad audience. I have been working quite hard on a cable, adapting electronics, and UPS monitoring software for NetBSD. I sent an email to the vendor about building a cable, and was told it wasn't possible. Naturally, I could not resist this challenge. I examined the Linux UPS HOWTO, various web pages, and built my own (learning quite a bit about RS-232 in the process). I was a little surprised to find that most of the serial communication information on the Internet began and ended with pin assignments. I couldn't even find a suitable newsgroup to ask questions in. After investigating several of the Linux packages, I decided it would still be worthwhile (instructive) to write my own. I've done so. However, my UPS only supports immediate shutdown (by raising a serial line for 50 milliseconds). This led to some rather interesting race conditions when trying to implement it in a stand-alone daemon. So, I figured I'd query the collective open-source knowledge base. Searching various mailing list archives has tended to generate more heat than light - there's a number of terms and synonyms people could use in describing the issue, and there are far more people asking where to find a particular software package than in discussing the real issues. So the questions I want to ask are: 1) What kind of kernel support would handle this in the cleanest way? 2) Where should the shutdown signal be asserted; in the userland monitoring program, the reboot command, the kernel reboot(2), or the instruction before HALT? ;) 3) Should there be any special handling after a powerfail shutdown? Specifically, should the OS idle in single-user mode until some condition is met, to avoid yo-yo-ing? 4) Anything else? I will summarize in a web page, so you need only email me and check my home page later (see the mail headers). Cc any mailing list at your own peril. While I wouldn't mind a cross-list technical discussion about the various approaches, they haven't worked in the past. Apologies for my semi-literacy; it has been a long night. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message