From owner-freebsd-questions Fri Sep 27 13: 2:42 2002 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 B651637B401 for ; Fri, 27 Sep 2002 13:02:40 -0700 (PDT) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 184BF43E86 for ; Fri, 27 Sep 2002 13:02:39 -0700 (PDT) (envelope-from Petri.Riihikallio@Metis.fi) Received: from [192.168.0.2] ([212.90.71.47]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id g8RK2XU08205; Fri, 27 Sep 2002 23:02:33 +0300 (EETDST) Mime-Version: 1.0 X-Sender: metis@pop.clinet.fi Message-Id: In-Reply-To: <4rvg4r5jdl.g4r@localhost.localdomain> References: <87elbf1r7d.fsf@pooh.int> <4rvg4r5jdl.g4r@localhost.localdomain> Date: Fri, 27 Sep 2002 23:02:31 +0300 To: swear@attbi.com (Gary W. Swearingen), questions@FreeBSD.ORG From: Petri Riihikallio Subject: Re: How to shut down cleanly by killing power Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > This way the system reboots, but the reboot is interrupted with >> powerdown at early stage. Not ideal, I agree, but a solution still. > >And it has the side-benefit of nicely handling the fairly common case of >where the power comes back on just long enough to get your UPS going >again, especially if it doesn't have enough power to get you through one >or more whole reboot-fsck-multi-user-UPS-shutdown cycles. (It's hard >to restart a whole mains power grid and it often doesn't work the first >time, as another poster indicated.) Of course you could do the >start-of-rc thing no matter how you handle the shutdown. Smarter UPSes can be programmed to recharge to some minimum level before supplying power, or at least wait some predefined time. For dumb UPSes I saw somewhere a suggestion to add a snippet like this to rc.early: if [ -f /etc/powerfail ] then sleep 120 rm -f /etc/powerfail fi >And if static linking the UPS software is a problem, you might consider >having it use /-based copies of their required libraries using the >LD_LIBRARY_PATH env.var. or maybe (?) using (at start of /etc/rc) >"/sbin/ldconfig /etc/ld-ups.so.conf". This shouldn't cause problems. -- Cheers, Petri Metis / Petri Riihikallio GSM: +358 400 505 939 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message