6386 shutdown: I CAN'T BELIEVE at&t was really this stupid!

Tom Neff tneff at bfmny0.UUCP
Thu Jun 15 13:19:15 AEST 1989


If you think about it for a second, by the time UNIX is totally ready
to be "rebooted now," you shouldn't have an active file system to
read scripts from.  The kernel is ALL THAT'S LEFT.  So the message
has to go there.  (I suppose it could be linked in at rebuild time.)

It seems sufficient to tell people, "Always run SHUTDOWN before turning
off power.  Never power down a running system."  If they DO reboot
after a shutdown, they cannot hurt anything without violating your
instructions, since the system would once again be "running."

By the way in my experience with my pair of 6386en, the only danger to
an inadvertent powerdown or crash is to the files you have changed since
the last 'sync' happened.  You can reboot the system every 5 minutes all
day long and never lose a thing if you don't change your files (edit etc.)
At worst, some log files might not get updated, but if you're sitting
there rebooting all the time, what's to log anyway.

To minimize the risk from power hits and crashes, I add a root cron job
that performs a 'sync ; sync' every 10 minutes.  I have not been reliably
persuaded that this is something the kernel does automatically on V/386,
although I know of UNIXen where that's true.  I feel more comfortable
doing it myself -- the overhead is negligible.  Only caveat - this doesn't
help files accessed remotely via RFS.  I wish there were an RFS equivalent
to force update of the cache but I haven't found one.

Also - to simplify the shutdown procedure in the event of my team's absence
(say, if someone had to run in and shut things off due to an emergency in
the building or an impending power shutdown), I create the following
entry in /etc/passwd:

	shutdown:x:0:1:Shut down the system:/usr/shutdown:/bin/sh

and the following /usr/shutdown/.profile:

	cd /
	exec /etc/shutdown -y -g15

I could do the same thing directly by naming shutdown as the startup 
shell, but I hate having to edit /etc/passwd just to change things 
like delay options. 
-- 
You may not redistribute this article for profit without written permission.
--
Tom Neff				UUCP:     ...!uunet!bfmny0!tneff
    "Truisms aren't everything."	Internet: tneff at bfmny0.UU.NET



More information about the Comp.unix.wizards mailing list