From: sinster@tioga.ucsc.edu (Darren Senn) Subject: Re: shutdown procedure? Date: 27 May 1992 20:09:56 GMT
In article <l268ufINNdat@almaak.usc.edu>, ajayshah@almaak.usc.edu (Ajay Shah) writes:
> (Why is Sun's /usr/etc/shutdown program 25k long (and world unreadable??)?)
Sun's /usr/etc/shutdown program is an actual program, not a shell script, so
it doesn't have to be readable by anyone to be executed (that's why the
"execute" permissions flag exists).
The program backgrounds itself, and sends a write to all users on the system
saying:
System going down in <some time duration>, please log off.
It then sends that message again 30 minutes , 15 minutes , 5 minutes , 1 minute,
and 30 seconds before the shutdown. If the original duration (you can set
it on the command line) is less than 30 minutes, than it starts at the
appropriate part of that list.
After the time has expired, it forcibly logs off anyone who is logged in
(including root), waits 30 seconds, then calls the system functions sync(),
and reboot().
This is why Sun's /usr/etc/shutdown is 25k and world unreadable.
I would personally LOVE to have a similar setup under Linux, but I've got
bigger projects I'm working on right now.
-- Darren Senn Phone: (408) 479-1521 sinster@scintilla.capitola.ca.us Snail: 1785 Halterman #1 Wasurenaide -- doko e itte mo soko ni anata wa iru yo. Santa Cruz, Ca 95062