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:[EMAIL PROTECTED]            (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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to