From owner-freebsd-hackers Fri Feb 6 07:49:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA02467 for hackers-outgoing; Fri, 6 Feb 1998 07:49:11 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fallout.campusview.indiana.edu (fallout.campusview.indiana.edu [149.159.1.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA02390 for ; Fri, 6 Feb 1998 07:49:04 -0800 (PST) (envelope-from jfieber@indiana.edu) Received: from localhost (jfieber@localhost) by fallout.campusview.indiana.edu (8.8.7/8.8.7) with SMTP id KAA11414; Fri, 6 Feb 1998 10:49:01 -0500 (EST) Date: Fri, 6 Feb 1998 10:49:01 -0500 (EST) From: John Fieber Reply-To: John Fieber To: "Bruce M. Walter" cc: 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" On Fri, 6 Feb 1998, Bruce M. Walter wrote: > > And halt(8) or shutdown(8) are incapable of doing the Right > > Thing? I'm still failing to see the point. > > The closest thing to a kernel callout which could call a UPS inverter > poweroff routine is at_shutdown/SHUTDOWN_POSTSYNC but some drivers (the > DPT driver for sure and maybe others) use this queue to flush unwritten > data from their cache to disk *AFTER* the final FS sync. Since that > callout list is not ordered, there's no way to insure the power wouldn't > be cut after that flush has been performed. Okay, I'm seeing the point (I think). You want to shutdown the OS, *then* tell the UPS to shut down. I suppose that is reasonable, since it at least gives the illusion of guaranteed cleanup as opposed to telling the UPS "shutdown in 60 seconds" and then calling halt(8) and hoping it can do its thing before the UPS shuts off. [I say "illusion" because if the time between a low battery warning and a dead battery is less than your halt(8) time, you are SOL either way. With a sufficiently smart and powerful UPS, you should be able to avoid such situations though.] -john