From: rfflaxa@cip.informatik.uni-erlangen.de (Ralf Flaxa) Subject: Re: shutdown command does not work. Date: Tue, 22 Jun 1993 16:02:48 GMT
cam@adied.oz.au (The Master) writes:
>hi,
>I haven't seen anybody talk about this and I can't find anything in the
>FAQ.
>I can't get the "shutdown" command to work. Currently I have to do
>"sync;halt" to shutdown. No matter what I do with shutdown it just
>prints up its command line option list (like I typed in something
>incorrectly) and doesn't do a shutdown.
>One other question, while we're here - I take it that the message that
>shutdown allows you to have is sent to all users who are logged in. Ok,
>how does it work? There doesn't appear to be a "wall" command.
>thanks,
> cameron.
I encountered this problem too, but I think I remember the solution ...
(It was posted some time ago in c.o.l, it's not a real solution but it
tries to explain the problem ...)
Yes, you are right that even if you use "shutdown -h now" sometimes
nothing
happens. (I use SLS 1.02 with kernel 99.10).
As far as I remember, shutdown -h tries to send a TERM signal first
and afterwards a KILL signal to all user processes, right. (To be polite
to the processes and give them a chance to clean up correctly)
As far as I remember (please flame me. if I am wrong ...)
shutdown consults /etc/utmp and/or /etc/wtmp to find out who
is currently logged in to notify those users and to send the
mentioned signals to their processes. (I never looked at the sources
of shutdown, I just repeat what I read)
So if there are any bad entries left in utmp or wtmp (maybe a program
dumped core or something similar) then those inconsistencies make
shutdown wait forever.
A simple solution is "reboot", which always works (appaerently it uses
another mechanism to term and kill processes or to find them out.)
Hope I remember right here and could give you an answer.
Ralf (rfflaxa@cip.informatik.uni-erlangen.de)