* Does 'shutdown' really shutdown?
@ 1994-06-23 7:41 Horst Luehrsen
1994-06-23 15:54 ` Peter da Silva
0 siblings, 1 reply; 7+ messages in thread
From: Horst Luehrsen @ 1994-06-23 7:41 UTC (permalink / raw)
We have a DEC Alpha with OSF/1 1.3 we use as a INGRES Database Server. We
added a skript /sbin/rc3.d/S97ingres to start up INGRES after reboot and
another skript /sbin/rc2.d/K00ingres to shut down INGRES when we shutdown
the system.
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?
Any suggestions?
HL
--
Horst Luehrsen [Horst.Luehrsen@Informatik.Uni-Erlangen.DE]
Martensstrasse 3, 91058 Erlangen
Tel: +49-9131-857884 Fax:+49-9131-32090
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Does 'shutdown' really shutdown?
1994-06-23 7:41 Does 'shutdown' really shutdown? Horst Luehrsen
@ 1994-06-23 15:54 ` Peter da Silva
1994-06-24 13:33 ` Eric Werme
0 siblings, 1 reply; 7+ messages in thread
From: Peter da Silva @ 1994-06-23 15:54 UTC (permalink / raw)
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?"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Does 'shutdown' really shutdown?
1994-06-23 15:54 ` Peter da Silva
@ 1994-06-24 13:33 ` Eric Werme
1994-06-24 16:58 ` Peter da Silva
0 siblings, 1 reply; 7+ messages in thread
From: Eric Werme @ 1994-06-24 13:33 UTC (permalink / raw)
peter@nmti.com (Peter da Silva) writes:
>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 wrong. :-)
>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.
I'm not completely certain how the shutdown stuff really works, but
"shutdown -r" runs reboot *after* running rc0.d/K*. I don't know if
rc2.d/K* is checked.
Put K00ingres in rc0.d and see if that works. It will be executed as
"K00ingress stop".
--
Eric (Ric) Werme | werme@zk3.dec.com
Digital Equipment Corp. | This space intentionally left blank.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Does 'shutdown' really shutdown?
1994-06-24 13:33 ` Eric Werme
@ 1994-06-24 16:58 ` Peter da Silva
1994-06-27 13:18 ` Eric Werme
0 siblings, 1 reply; 7+ messages in thread
From: Peter da Silva @ 1994-06-24 16:58 UTC (permalink / raw)
In article <werme.772464781@alingo.zk3.dec.com>,
Eric Werme <werme@zk3.dec.com> wrote:
> I'm not completely certain how the shutdown stuff really works, but
> "shutdown -r" runs reboot *after* running rc0.d/K*.
I hate like hell to contradict you, since you're at DEC, but I think
you're wrong.
> I don't know if rc2.d/K* is checked.
I missed that he put the shutdown script in rc2.d. You're right that it's
the rc0.d directory that /sbin/rc0 looks at. The K scripts in rc2.d are used
when going from run level 3 to run level 2 or lower.
*however*, we've had problems in the past where shutdown -r didn't properly
run rc0. In addition, examining shutdown with "strings" shows that it's
calling "/sbin/reboot" directly. And, as I've mentioned, there's no code
in /sbin/rc0 to call reboot.
(It also shows an amazing amount of stuff statically linked in the
executable, including prompts from programs like "passwd". What
gives?)
--
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?"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Does 'shutdown' really shutdown?
1994-06-24 16:58 ` Peter da Silva
@ 1994-06-27 13:18 ` Eric Werme
1994-06-27 15:42 ` Peter da Silva
0 siblings, 1 reply; 7+ messages in thread
From: Eric Werme @ 1994-06-27 13:18 UTC (permalink / raw)
To: peter
In comp.unix.osf.osf1 you write:
>In article <werme.772464781@alingo.zk3.dec.com>,
>Eric Werme <werme@zk3.dec.com> wrote:
>> I'm not completely certain how the shutdown stuff really works, but
>> "shutdown -r" runs reboot *after* running rc0.d/K*.
>I hate like hell to contradict you, since you're at DEC, but I think
>you're wrong.
No problem. Ask me something about NFS. One thing I like to do with
the rc3 script is print the name of the script it is about to execute.
You might want to do the same with the rc0 script:
# Kill procedures
for f in /sbin/rc0.d/K*
do
add ---> echo -------- $f
if [ -s $f ]; then
/sbin/sh $f stop
fi
done
>*however*, we've had problems in the past where shutdown -r didn't properly
>run rc0.
I don't recall seeing that roll by in the bug reports. You might want to
talk to Customer Support about it.
> In addition, examining shutdown with "strings" shows that it's
>calling "/sbin/reboot" directly.
Like I said ""shutdown -r" runs reboot...."
>(It also shows an amazing amount of stuff statically linked in the
> executable, including prompts from programs like "passwd". What
> gives?)
Well, everything in /sbin is linked statically. Shutdown has to write
in the syslog file and includes the user's name. That drags in code
that deals with /etc/passwd, and I'd guess one of the modules has a
routine that shutdown doesn't call, but does includes a call to the
routine that changes passwords. We've never had the time to clean up
all those nits. Look at "/usr"/sbin/shutdown for a variant that uses
the shared library - there's a lot less extra stuff.
--
Eric (Ric) Werme | werme@zk3.dec.com
Digital Equipment Corp. | This space intentionally left blank.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Does 'shutdown' really shutdown?
1994-06-27 13:18 ` Eric Werme
@ 1994-06-27 15:42 ` Peter da Silva
1994-06-27 16:18 ` Digital Jesus
0 siblings, 1 reply; 7+ messages in thread
From: Peter da Silva @ 1994-06-27 15:42 UTC (permalink / raw)
In article <2umjjp$nn3@nntpd.lkg.dec.com>,
Eric Werme <werme@zk3.dec.com> wrote:
> No problem. Ask me something about NFS. One thing I like to do with
> the rc3 script is print the name of the script it is about to execute.
> You might want to do the same with the rc0 script:
Next time I'm playing with one of the workstations I'll do that.
Short of that, though, I can't see any indication that shutdown -r runs any
rc scripts. There's nothing in inittab or rc0 to make rc0 run reboot. When
rc0 gets to the end it either calls "init S" or "halt -q", so shutdown can't
run it and then call reboot, and init can't run it and then call reboot,
and there's no other code to run the rc0 scripts anywhere that I can see.
I haven't called it in as a bug because I don't know what your *intent* is,
here. After all, the core is still the stock BSD code with /sbin/reboot
and /sbin/halt. I'm grateful that it has run levels at all.
Now that you've implied that you *do* want it to work right (you in the
collective sense, of course) I'll see about pushing it through channels.
How about adding a "-i" option to shutdown as well, so we can add custom
run levels (like standalone backup) more easily?
--
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?"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Does 'shutdown' really shutdown?
1994-06-27 15:42 ` Peter da Silva
@ 1994-06-27 16:18 ` Digital Jesus
0 siblings, 0 replies; 7+ messages in thread
From: Digital Jesus @ 1994-06-27 16:18 UTC (permalink / raw)
I am interested in finding a binary of the latest version of XV for the DEC 3000 running OSF/1 2.0 . gatekeeper has the source, but as usual, Im looking for
convienience, and not to have to compile the beast. Any help would be greatly
appreciated.
Matthew G Harrigan
mgha@grinch.itl.saic.com
flash@cyber.net
mcr@encinitas.csusm.edu
--
flash@cyber.net
root@mcr.com
--"THIS .... is what life is all about, my friend, this one thing. What the hellTHIS is ...I dont know"
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1994-06-27 16:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-06-23 7:41 Does 'shutdown' really shutdown? Horst Luehrsen
1994-06-23 15:54 ` Peter da Silva
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox