From owner-freebsd-questions@FreeBSD.ORG Fri Mar 10 11:26:41 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 8C2F916A420 for ; Fri, 10 Mar 2006 11:26:41 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from asmtp-out1.blueyonder.co.uk (asmtp-out1.blueyonder.co.uk [195.188.213.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 469EF43D69 for ; Fri, 10 Mar 2006 11:26:38 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [62.31.10.79] (helo=[192.168.0.2]) by asmtp-out1.blueyonder.co.uk with esmtp (Exim 4.52) id 1FHflV-00086k-8d; Fri, 10 Mar 2006 11:26:37 +0000 Message-ID: <4411626A.1090808@dial.pipex.com> Date: Fri, 10 Mar 2006 11:26:34 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.12) Gecko/20060305 X-Accept-Language: en MIME-Version: 1.0 To: Bob Johnson References: <20060309174609.GA14114@ns.museum.rain.com> <20060309200708.GA15255@ns.museum.rain.com> <54db43990603091419n73d44758ne475fc920848e43c@mail.gmail.com> In-Reply-To: <54db43990603091419n73d44758ne475fc920848e43c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: coming back up after power failure (UPS) 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: Fri, 10 Mar 2006 11:26:41 -0000 Bob Johnson wrote: >- When the UPS believes it is about to run out of battery power and >shut down, the OS shuts down to single user mode and starts a script >that will reboot the system in five minutes (or long enough to be >sure the batteries will run down first). >- If the UPS does shut down, when power is restored, the BIOS will >detect the event and power up the PC normally. It will boot as >normal. >- If the UPS never shuts down (because line power is restored) the >script eventually times out and reboots the system anyway. > >I tried to make this work a few years ago, but could find no way to >start a script after shutting down to single user mode. I posted a >query about it but got no replies, so I quit worrying about it. I've >since seen some hint that it is now possible to do that, but I didn't >follow it up. Can anyone tell me how to do that? > man rc.d :-) Every script in /etc/rc.d with a shutdown keyword will be run when shutting down with the param "stop". If your NUT shutdown script touched some special file, your rc.d script could key off that to do a reboot in 5 minutes. I thinks that's what you're describing. --Alex