* Craig McLean ([EMAIL PROTECTED]) wrote: > 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.
true -- init knows nothing of the /etc/rc?.d/ directories. but init knows about /etc/inittab, which contains the line l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6 # Normally not reached, but fallthrough in case of emergency. z6:6:respawn:/sbin/sulogin which reveal that, on entry to, say, runlevel 3, the script "/etc/init.d/rc" is run with a sole argument "3". looking at the /etc/init.d/rc script, it uses its sole argument to determine which /etc/rc?.d/ directory to look in; there, it runs any K* scripts with an argument "stop", and then any S* scripts with an argument "start". if a K* script doesn't send any "kill -HUP `pidof mydaemon`" then the process "mydaemon", if running, will stay running. likewise, if a S* script doesn't actually launch a daemon, then no daemon is launched. in february of 2000 (when the manpage for init was last tweaked, from what i can tell) init may have operated they way it's describe there. but the way it works on debian potato is that it calls a script (/etc/init.d/rc) that calls scripts (/etc/rc*.d/[KS]*) with certain arguments. they're spozed to be the ones to do the job -- and this is a nice, new, modular layout. you've discovered the biggest achilles' heel of the *nix world: "the documentation was probably right at one point, but..." to determine that "point", check the "last-modified" date and keep exploring if you need to... -- DEBIAN NEWBIE TIP #39 from Roy Culley <[EMAIL PROTECTED]> : Wondering why the pundits say that CSH SCRIPTS ARE CONSIDERED HARMFUL? Although "tcsh" has improved on "csh" there are still issues. For the full scoop, read http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ Also see http://newbieDoc.sourceForge.net/ ...