From owner-freebsd-questions@FreeBSD.ORG Thu May 25 05:15:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C4CC16A420 for ; Thu, 25 May 2006 05:15:13 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp5.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C79C143D45 for ; Thu, 25 May 2006 05:15:12 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp5.server.rpi.edu (8.13.1/8.13.1) with ESMTP id k4P5FAvi027135; Thu, 25 May 2006 01:15:11 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <200605221454.k4MEsUdn088316@himinbjorg.tucs-beachin-obx-house.com> References: <200605221454.k4MEsUdn088316@himinbjorg.tucs-beachin-obx-house.com> Date: Thu, 25 May 2006 01:15:09 -0400 To: Scott "Tuc" Ellentuch at T-B-O-H , freebsd-questions@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) Cc: Subject: Re: Anyone using sysutils/nut ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2006 05:15:13 -0000 At 10:54 AM -0400 5/22/06, Scott "Tuc" Ellentuch at T-B-O-H wrote: >Hi, > > I'd like to find out where to put the >"upsdrvctl shutdown" in the shutdown process. Putting >it in rc.shutdown causes me to have dirty filesystems >constantly that sometimes don't allow the system to >come up. I seem to recall someone saying that the best way to do this was to create some flag-file, and then reboot instead of shutdown. Then very early in the system-startup you look for that flag-file, and run 'upsdrvctl shutdown'. Since you just successfully went through the complete shutdown, all the disks should be in a safe state. So, the UPS will yank the power out from under the computer, but it won't matter. The trick, of course, is to add some logic there so you can boot up after the power has returned! Either check the last-change date of the flag-file, or maybe do something to re-mount '/' as writable, delete the one file, and re-mount it back as read-only. I have never done any of this with my own UPS, so I'm not sure of the details... :-) -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu