From owner-freebsd-questions@FreeBSD.ORG Thu Jan 10 09:25:19 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA6916A41B for ; Thu, 10 Jan 2008 09:25:19 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 068F013C474 for ; Thu, 10 Jan 2008 09:25:18 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.13.8) with ESMTP id m0A9PCfO047359; Thu, 10 Jan 2008 03:25:12 -0600 (CST) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20080110025841.023a9bb8@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Thu, 10 Jan 2008 03:24:54 -0600 To: "Derrick Ryalls" , "FreeBSD Questions" From: Derek Ragona In-Reply-To: References: Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Nut and RAID on FreeBSD 7.0 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, 10 Jan 2008 09:25:19 -0000 At 06:51 PM 1/9/2008, Derrick Ryalls wrote: >Greetings, > >I have a RAID fileserver plugged into a UPS and nut is able to >communicate with it successfully. With the winds making the lights >flicker, I started looking into having the computer shut down when >power goes out for more than say 5 minutes or so. Looking at the >documentation, I found that the 'true' solution is more like the >system goes into a safe state when the battery gets low, then the ups >eventually dies. When power is restored, the UPS and computer are >supposed to both come back to life. This would be a great system to >have in place, but it does sound a bit risky and so may not be worth >doing just to save my home fileserver. > >The instructions and the conf file have the shutdown command of >'shutdown -h +0' which will halt the system. The man page for halt >says the the disk cache will be flushed, but doesn't mention anything >about going to read-only or anything. I suppose my first question is >whether or not flushing the cache is sufficient to save the RAID (5) >array, or if I need to find a way to get the file systems into read >only mode? > >The second question has to do with a rc.d script that nut recommends >creating. The script does a 'upsdrvctl shutdown' and then a sleep >120, basically waiting for the machine to die while in the script. >Won't this block the other rc.d scripts? Also, is this the magic part >that enables the machine to auto power up when power is restored? > >Changing the shutdown command in nut to 'shutdown -p +0' looks like >the sure fire way to get the system down clean before the power is >lost, but if my concerns are not valid, then I could be missing out on >some nice functionality for no reason. > >Does anyone have experience with this? I have my servers all using nut to safely shutdown. My configuration is the servers are set up with one as master for nut, that master connected to the UPS. The other servers are slaves and get their nut information from the master. My setup has the servers wait until the UPS is on low battery, then they all shutdown. As a separate part of the setup, the servers are set in their BIOS to power on, after a power failure. This is in the BIOS power setup. So if there is a minor power problem, the servers run from battery. In a larger power outage, they are shutdown cleanly once the battery level is low, and power up automatically once power is restored. In my upsmon.conf file I have this: SHUTDOWNCMD "/sbin/shutdown -h +0" If you want more specifics, I can look through the configuration files and email you relevant settings. As far as my experiences using nut with RAID and different setups if the shutdown command works from a command line, it will work the same from nut. I would also suggest you test your setup. Pull the plug on your UPS and watch what happens. Also you should employ other monitoring systems and scripts, should a system not reboot correctly, you do want to know that quickly. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.