From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 05:35:19 2004 Return-Path: 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 27B6B16A4CF for ; Fri, 20 Feb 2004 05:35:19 -0800 (PST) Received: from carrick.bishnet.net (carrick.bishnet.net [217.204.9.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0025743D1F for ; Fri, 20 Feb 2004 05:35:18 -0800 (PST) (envelope-from dom@bishnet.net) Received: from cpc2-warw1-3-0-cust35.brhm.cable.ntl.com ([80.5.185.35] helo=mail.dom.bishnet.net ident=mailnull) by carrick.bishnet.net with esmtp (TLSv1:AES256-SHA:256) (Exim 4.30; FreeBSD) id 1AuAoD-000M8h-B2 for freebsd-questions@FreeBSD.ORG; Fri, 20 Feb 2004 13:35:13 +0000 Received: from monster.dom.bishnet.net ([192.168.3.100] helo=monster) by mail.dom.bishnet.net with esmtp (Exim 4.30; FreeBSD) id 1AuAoD-000AQc-6O for freebsd-questions@FreeBSD.ORG; Fri, 20 Feb 2004 13:35:13 +0000 From: "Dominic Bishop" To: Date: Fri, 20 Feb 2004 13:38:39 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thread-Index: AcP3ttka6RoAnNQJTNqSxflQaByNNA== X-Bishnet-MailScanner-Information: Contact postmaster@bishnet.net X-Bishnet-MailScanner-VirusCheck: Found to be clean Message-Id: <20040220133519.0025743D1F@mx1.FreeBSD.org> Subject: Custom startup+shutdown scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 13:35:19 -0000 I am shortly going to try and install a Belkin universal UPS on one of my FreeBSD machines running 5.2 using the nut utility. Due to a failing in the Belkin protocol it requires some custom startup/shutdown scripting to make it work in an unsupervised recovery, This is shown in point 4 of http://eu1.networkupstools.org/protocols/belkin-universal/ The shutdown code needs to be run without disks mounted as read/write since it effectively holds the machine until power comes on or the UPS batteries die, in the latter case this would cause an unclean shutdown with the disks fully mounted and system up. The startup script needs to be run before disks are mounted in read/write and before filesystem checks for similar reasons. I've looked through some of the rc scripts, namely rc.shutdown and a few others but really aren't sure as to where I should make these changes so they execute at the correct time in the boot/shutdown process. Could anyone tell me where I should be making these additions? Regards, Dominic Bishop