From owner-freebsd-questions@FreeBSD.ORG Tue May 23 04:06:20 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 AE19916A458 for ; Tue, 23 May 2006 04:06:20 +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 074CF43D49 for ; Tue, 23 May 2006 04:06:19 +0000 (GMT) (envelope-from ml@t-b-o-h.net) Received: from himinbjorg.tucs-beachin-obx-house.com (c-69-249-95-97.hsd1.nj.comcast.net [69.249.95.97]) (authenticated bits=128) by vjofn.tucs-beachin-obx-house.com (8.12.9/8.12.9) with ESMTP id k4N46I9t018440; Tue, 23 May 2006 00:06:19 -0400 (EDT) Received: from himinbjorg.tucs-beachin-obx-house.com (localhost.tucs-beachin-obx-house.com [127.0.0.1]) by himinbjorg.tucs-beachin-obx-house.com (8.13.3/8.12.10) with ESMTP id k4N46IY7009840; Tue, 23 May 2006 00:06:18 -0400 (EDT) (envelope-from ml@t-b-o-h.net) Received: (from tbohml@localhost) by himinbjorg.tucs-beachin-obx-house.com (8.13.3/8.13.1/Submit) id k4N46IFI009839; Tue, 23 May 2006 00:06:18 -0400 (EDT) (envelope-from tbohml) From: Scott "Tuc" Ellentuch at T-B-O-H Message-Id: <200605230406.k4N46IFI009839@himinbjorg.tucs-beachin-obx-house.com> To: petermatulis@yahoo.ca (Peter) Date: Tue, 23 May 2006 00:06:18 -0400 (EDT) In-Reply-To: <20060522231124.89973.qmail@web60014.mail.yahoo.com> X-Mailer: ELM [version 2.5 PL8] 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: Tue, 23 May 2006 04:06:21 -0000 > > > --- 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. > > You don't. Instead, use the nut configuration files (ups.conf, > upsd.conf, upsmon.conf, hosts.conf, upsd.users). upsdrvctl is called > internally from upsd. That is how I understand it. > 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: if (test -f /etc/killpower) then echo "Killing the power, bye!" /usr/local/ups/bin/upsdrvctl shutdown sleep 120 # uh oh... the UPS poweroff failed! # you probably should reboot here to avoid getting stuck # *** see the section on power races below *** fi (There is more.....) In talking to the people on the NUT list, no one mentioned that it was called from upsd. Thanks, Tuc