Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: peter@nmti.com (Peter da Silva)
Subject: Re: Does 'shutdown' really shutdown?
Date: Thu, 23 Jun 1994 15:54:50 GMT	[thread overview]
Message-ID: <id.JTMA1.5AF@nmti.com> (raw)
In-Reply-To: 2ubec7Ebqk@uni-erlangen.de

In article <2ubec7Ebqk@uni-erlangen.de>,
Horst Luehrsen <Horst.Luehrsen@Informatik.Uni-Erlangen.DE> wrote:
> If we use shutdown -r to shutdown and reboot the machine, the machine shuts
> down really fast and I think, it doesn't execute the /sbin/rc2.d/K00ingres,
> but instead kills all processes.

> Am I right with this guess? Or did I put K00ingres in the wrong directory?

You're right.

You're being hosed by the BSD shutdown model. In BSD based systems it sends
a signal 15 to all procs, waits "a reasonable time", then sends a signal 9.
In System V based systems it sends a signal to init to change the run level,
and then init's responsible for running shutdown scripts.

DEC merges the two inits. For regular shutdown, it (or init, I'm not too clear)
runs the shutdown scripts. For shutdown -r it runs the command "reboot". What
it should do is set the run level to 6 and let init run reboot when it finishes
changing the run level. The stock OSF inittab doesn't even *have* a run level
six defined.

:-<

System V defines init levels 0 and 6 like this:

r0:056:wait:/etc/rc0  1> /dev/console 2>&1 </dev/console
sd:0:wait:/etc/uadmin 2 0 >/dev/console 2>&1 </dev/console
rb:6:wait:/etc/uadmin 2 1 >/dev/console 2>&1 </dev/console

It runs rc0 (which sees it's going from level 2 or 3 to level 6, and runs
rc0.d/K*) then does a uadmin 2 1, which does a reboot.

In OSF, you get this:

s0:0:wait:/sbin/rc0 off < /dev/console > /dev/console 2>&1

I'd suggest that DEC add a "reboot" option to /sbin/rc0:
that does:

#
# Reboot if it's booting time...
#
if [ "$ARGONE" = reboot ]; then
	/sbin/reboot
else
	... existing code ...
fi

then add:

s6:6:wait:/sbin/rc0 reboot < /dev/console > /dev/console 2>&1

So you'd use "init 6" to reboot cleanly, like in Ssystem V.
-- 
Peter da Silva                                            `-_-'
Network Management Technology Incorporated                 'U`
1601 Industrial Blvd.     Sugar Land, TX  77478  USA
+1 713 274 5180                       "Hast Du heute schon Deinen Wolf umarmt?"


  reply	other threads:[~1994-06-23 15:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-06-23  7:41 Does 'shutdown' really shutdown? Horst Luehrsen
1994-06-23 15:54 ` Peter da Silva [this message]
1994-06-24 13:33   ` Eric Werme
1994-06-24 16:58     ` Peter da Silva
1994-06-27 13:18       ` Eric Werme
1994-06-27 15:42         ` Peter da Silva
1994-06-27 16:18           ` Digital Jesus
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox