[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Init not behaving the way man says it does?



Ok so the rc script explains why not all of the S/K entries get run on
runlevel changes.

My next question:  The init man page says all of the processes in the same
process group as init that aren't also in the next run level should get a
SIGTERM and a SIGKILL signal killing them.  This doesn't seem to be
happening.  cron and syslog are both in the same process group as init but
they aren't getting killed.  As an experiment I removed the cron and syslog
entries from rc4.d and then trasferred to run level 4 from 2.  Yet cron and
syslog weren't killed.

Incidentally I don't think the removing of entries from the run level
directories should make a difference anyways because I know that init
doesn't actually have any knowledge of rc directories.

I do know that when I transfer between various user defined run levels the
signals aren't getting sent, but when I transfer between from a user defined
run level to a system runlevel the signals do get sent.



----- Original Message -----
From: "will trillich" <will@serensoft.com>
To: <debian-user@lists.debian.org>
Sent: Friday, June 15, 2001 10:39 PM
Subject: Re: Init not behaving the way man says it does?


> On Fri, Jun 15, 2001 at 09:23:06AM -0500, Andrew Dixon wrote:
> > Craig McLean wrote:
> > >
> > > The man page states that whenever you transition between two run
levels, it
> > > sends all processes not in the new run level the SIGTERM and then
SIGKILL
> > > signals.  Also in the debian case it runs the rc script which does all
the K
> > > entries and all the S entries, in the new runlevels    rc[0-6sS].d
> > > directory. When I transition from run level [2345] to run level
[016sS] this
> > > is exactly what happens.  However when I try to transition from any of
the
> > > user defined run levels to any of the other user defined run levels
(going
> > > from [2345] to [2345]) it doesn't do what it is supposed to do.
> >
> > check out the /etc/rc script.  It's what actually runs all of the
> > scripts in the rc[0-6sS].d directories.  I think it's smart enough to
> > only start services that are not in the previous run level instead of
> > killing and restarting everything.  So if you switch from level 2 to 3
> > only those S scripts is /etc/rc3.d that are not in /etc/rc2.d will be
> > run.
>
> use the source, luke:
>
> pager /etc/init.d/rc
>
> when entering runlevel Q, it first runs all relevant K* scripts
> thus:
>
> for daemon in /etc/rc$RUNLEVEL.d/K[0-9][0-9]*
> do
> $daemon stop
> done
>
> (basically).  after killing all the K* script daemons, it starts
> the S* scripts like so:
>
> for daemon in /etc/rc$RUNLEVEL.d/S[0-9][0-9]*
> do
> $daemon start
> done
>
> (for the most part). it doesn't seem to care a whit whether
> you've got K01postgres and S01postgres in the same runlevel, nor
> does it appear to check whether you've been running S77exim
> before shutting it down with K38exim. it just runs all K* with
> arg 'stop', then all S* with arg 'start'.
>
> unless i'm mistaken.
>
> --
> DEBIAN NEWBIE TIP #46 from Will Trillich <will@serensoft.com>
> :
> Troubled by MAC-FORMAT TEXT FILES? There are many ways
> to translate CR to LF. VIM can help, with these steps:
> :set ffs=mac
> :e!
> :set ff=unix
> and then save/write the file (":opt" for more info).
> In perl, this'll do the trick:
> perl -pi.mac -l12 -015 -e ';' filename*pattern.txt
> (that's a <hyphen-el-one-two> and <hyphen-zero-one-five>, by
> the way -- see "perldoc perlrun" for more info.)
>
> Also see http://newbieDoc.sourceForge.net/ ...
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org
>



Reply to: