From owner-freebsd-questions@FreeBSD.ORG Thu May 25 01:39:24 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 AE5B216A425 for ; Thu, 25 May 2006 01:39:24 +0000 (UTC) (envelope-from ml@t-b-o-h.net) Received: from vjofn.tucs-beachin-obx-house.com (vjofn.tucs-beachin-obx-house.com [204.107.90.128]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BF1C43D45 for ; Thu, 25 May 2006 01:39:24 +0000 (GMT) (envelope-from ml@t-b-o-h.net) Received: (from tbohml@localhost) by vjofn.tucs-beachin-obx-house.com (8.12.9/8.12.9) id k4P1dNp0099848; Wed, 24 May 2006 21:39:23 -0400 (EDT) From: Tuc at T-B-O-H Message-Id: <200605250139.k4P1dNp0099848@vjofn.tucs-beachin-obx-house.com> To: mikhailg@webanoide.org (Mikhail Goriachev) Date: Wed, 24 May 2006 21:39:23 -0400 (EDT) In-Reply-To: <4474FE14.80205@webanoide.org> from "Mikhail Goriachev" at May 25, 2006 10:45:08 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions 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 01:39:24 -0000 > > Scott Tuc Ellentuch at T-B-O-H wrote: > >>> I'm going by : > >>> > >>> /usr/local/share/doc/nut/shutdown.txt > >>> > >>> Subsection "How you set it up", item #2 : > >>> > >>> 2. Edit your shutdown scripts to check for the POWERDOWNFLAG so they > >>> know > >>> when to power off the UPS. You must check for this file, as you > >>> don't > >>> want this to happen during normal shutdowns! > >>> > >>> You can use upsdrvctl to start the shutdown process in your UPS > >>> hardware. Use this script as an example, but change the paths to > >>> suit your system: > >> My bad. I did edit rc.shutdown on both a 5.4 and a 6.0 system with no > >> troubles. The end of my file shows this: > >> > >> # Inserted next 5 lines March 13, 2006 for UPS shutdown. > >> if (test -f /etc/killpower) > >> then > >> echo "Killing the power, bye!" > >> /usr/local/libexec/nut/upsdrvctl shutdown > >> fi > >> > >> echo '.' > >> exit 0 > >> > > But doesn't that immediately shut down your system causing it > > to need FSCK when it comes back up? > > > Hi, > > I got the following line in /usr/local/etc/nut/upsmon.conf: > > SHUTDOWNCMD "/sbin/shutdown -p now" > > As far as I'm concerned the system powers off cleanly without the need > of FSCK. > > Cheers, > Mikhail. > The issue isn't with the upsmon or SHUTDOWNCMD... Its with the fact that /etc/killpower gets set, and somewhere you need to put "upsdrvctl shutdown". Its during the "shutdown -p now" that at some point needs to be run, and if its run in /etc/rc.shutdown then the shutdown isn't finished and shutting it off at that point the filesystems are dirty. Thanks, Tuc