Re: init finagling

From: Fielder George Dowding <fgdowding@gmail.com>
Date: Sat Sep 09 2006 - 03:11:52 AKDT

On 9/8/06, bryanm@acsalaska.net <bryanm@acsalaska.net> wrote:
>
> On Fri, Sep 08, 2006 at 04:07:31PM -0800, Fielder George Dowding <
> fgdowding@gmail.com> wrote:
> > On 9/8/06, bryanm@acsalaska.net <bryanm@acsalaska.net> wrote:
> > >
> > >I'm studying the init scripts on my box, and I've found something
> > >confusing that I haven't been able to figure out on my own.
> > >
> > >Consider this list of steps:
> > > * I type 'telinit 1' to go to single-user mode
> > > * init executes the commands in rc.K, as per /etc/inittab
> > > * at the bottom of rc.K is the command 'telinit -t 1 1'
> > >
> > >This looks like an infinite loop to me. What am I missing?
> > >
> >
> > Oh! Wow! I get to say _RTM_ (notice I am saying it nicely). To wit: the
> -t 1
> > means one second where the second 1 is the run level. From the man page:
> > "telinit can tell init how long it should wait between sending
> processes
> > the SIGTERM and SIGKILL signals. The default is 5 seconds, but this can
> be
> > changed with the -t option." So I guess, this is the hurry-up signal.
>
> I did indeed RTM. Notice that the command I use to start the
> transition is 'telinit 1'. After I do that, according to inittab,
> init processes the commands in rc.K. At the end of that file is
> the _same_ command I used to start the transition, signal delay
> notwithstanding.
>
> Do you see what I mean? I could just as easily issue the command
> 'telinit -t 1 1', and the commands would be identical. At what
> point does init stop processing commands and give me a prompt?
>
> --
> Bryan Medsker
> bryanm@acsalaska.net
>
> ---------
>
Right. That is the problem with non-Debian distributions, they really are
strange =:-)}}}

In Debian, which claims to conform to System V, Release 4, there is no file
"rc.K", a fact I overlooked initially. Sorry, I just should have hit the
delete key. I do note there seems to be some connection between runlevel s
or S (start = boot) and runlevel 1 (~ single user), to wit: "Runlevel S is
used to initialize the system on boot. When starting runlevel S (on
boot) or runlevel 1 (switching from a multi-user runlevel) the system is
entering ``single-user mode'', after which the current runlevel is S." HUH!
I canīt say I understand the events this sentence purports to describe.

Then further down in the man page, Debian has this dire warning: "On a
Debian system, entering runlevel 1 causes all processes to be killed except
for kernel threads and the script that does the killing and other processes
in its session. As a consequence of this, it isn't safe to return from
runlevel 1 to a multi-user runlevel: daemons that were started in
runlevel S and are needed for normal operation are no longer running. The
system should be rebooted."

There seems to be a rather strong suggestion to read the man pages for
shutdown(8) and inittab(5) to gain understanding of changing run levels.

Yes, it appears much study is needed to understand this stuff.

-- 
Fielder George Dowding, KL7FHX
dba Iceworm Enterprises
Debian GNU/Linux Etch
User Number 269482
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Sep 9 03:22:28 2006

This archive was generated by hypermail 2.1.8 : Sat Sep 09 2006 - 03:22:29 AKDT