From owner-freebsd-current Thu Sep 23 22:37:13 1999 Delivered-To: freebsd-current@freebsd.org Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1]) by hub.freebsd.org (Postfix) with SMTP id 6CC4214CD0 for ; Thu, 23 Sep 1999 22:37:03 -0700 (PDT) (envelope-from john@nlc.net.au) Received: (qmail 19631 invoked from network); 24 Sep 1999 15:36:57 +1000 Received: from nhj.nlc.net.au (HELO saruman) (203.24.133.1) by nhj.nlc.net.au with SMTP; 24 Sep 1999 15:36:57 +1000 Message-ID: <011701bf064e$d0f7f4f0$6cb611cb@scitec.com.au> From: "John Saunders" To: "FreeBSD current" Subject: Automating filesystem check at boot time Date: Fri, 24 Sep 1999 15:36:56 +1000 Organization: NORTHLINK COMMUNICATIONS MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I administer a number of remote FreeBSD boxes and starting with 3.x they have been unreliable at rebooting. We all know FreeBSD wants to keep running forever, however it seems to be at the expense of reboot stability. I have found the following problems occuring. 1) After a power failure the filesystem is inconsistent such that a manual fsck is required. Actually this can also occur following a crash or failed shutdown. However I must admit that FreeBSD does this less than Linux, but it still does it. 2) After running "shutdown -r now" FreeBSD will kill off all processes but complain that is unable to kill everything. It then says Syncing disks...done. Then hangs until the reset button is pressed. I think that amd is causing this. The time this happened was following a reboot to clear an amd problem when the NFS server was isolated from from the network for some time. My previous hacks at Linux has led me to the following patch to /etc/rc which I have been using for a while on FreeBSD to solve point 1. It has saved me a lot of driving on 2 occasions. The program "waitkey" is one I wrote that sleeps for the specicifed and returns TRUE (0), unless a key is pressed in which case it returns the ASCII code for the key. +++ rc Wed Aug 18 13:59:59 1999 @@ -69,6 +69,12 @@ ;; 8) echo "Automatic file system check failed... help!" + if waitkey 30; then + exit 1 + fi + fsck -y + reboot + echo "reboot failed... help!" exit 1 ;; 12) Anyway I am proposing a method where FreeBSD can be configured though an rc.conf knob to be more friendly in an unattended situation. I propose as a first step that a knob called "unattended_operation" be added with a default value of "NO". Enabling this knob can be used to allow code like the above to be executed. It can also be used to force the sysctl variable "debug.debugger_on_panic" to 0 in the rc file. I can also contribute the waitkey.c program. It may even be useful for other stuff with some changes to the command syntax. Does anybody have any strong opinions on this, either way? I have this running on my machine at present so I'm not too fussed either way, just thought it might be useful for other people as well. I can supply code and patches, but I would like somebody with commit privs to look over the code, make suggestions and eventually commit the work. Cheers. -- +------------------------------------------------------------+ . | John Saunders - mailto:john@nlc.net.au (EMail) | ,--_|\ | - http://www.nlc.net.au/ (WWW) | / Oz \ | - 02-9489-4932 or 041-822-3814 (Phone) | \_,--\_/ | NORTHLINK COMMUNICATIONS P/L - Supplying a professional, | v | and above all friendly, internet connection service. | +------------------------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message