Art Alexion on 2 Nov 2005 13:35:45 -0000


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

Re: [PLUG] Editing System V init


Stephen Gran wrote:

>On Tue, Nov 01, 2005 at 08:42:38PM -0500, Art Alexion said:
>  
>
>>Stephen Gran wrote:
>>
>>    
>>
>>>On Tue, Nov 01, 2005 at 06:11:09PM -0500, Art Alexion said:
>>>
>>>      
>>>
>>>>By default, my distro tries to run an ntp update script before it
>>>>initializes ppp.  The documentation on the distro web site shows you how
>>>>to disable the ntp init script, but I don't want to do that.  I want to
>>>>edit the startup so that it runs _after_ ppp is initialized.
>>>>
>>>>I installed the webmin init module, but need to read about the runlevel
>>>>and 'start at' and 'stop at' settings before I make any changes.  Google
>>>>hasn't helped me find documentation.  Can anyone recommend a place?
>>>>        
>>>>
>>>The way it works, roughly (and totally solution dependant, but most
>>>linux distros do it this way these days) is that the kernel boots, and
>>>at some point hands thing off to init.  init runs all of the scripts
>>>that start with S in the rcS.d directory, and then switches to the
>>>'default' run level - what that default is is completely distribution
>>>dependant, although I think Redhat-alikes all use 5.
>>>
>>>Then init runs all scripts in rc5.d directory that begin with an S with
>>>the start argument (and really, it should also run all scripts that begin
>>>with a K with the stop argument, but many don't).  The only real things
>>>to know about the hacked SysV init that most linux distros use is that
>>>
>>>a) scripts whose names start with S should get run with the start
>>>  argument
>>>b) scripts whose names start with K should get run with the stop
>>>  argument  
>>>c) All scripts in a directory are run in numerical order
>>>d) At boot, S is first, then default run level.
>>>
>>>That's the basics for managing it.
>>>
>>>      
>>>
>>That is what is complicated.  The ntpdate script in in rcS.d and the ppp
>>script is in rc2d through rc5.d.  I fear putting ppp in rcS.d is a bit
>>too radical and may lead to unintended consequences.
>>
>>BTW, I am running Kubuntu 5.04 (hoary) which is Debian based.  The only
>>documentation it points to is chapter 9 of the Debian Policy Manual.
>>    
>>
>
>Ah, I see the problem.  You are using pppoe or something, and pppd
>starts too late for ntpdate, so boot up takes forever.
>  
>

That seems to be the problem that many are having.  My ntpdate has a
short timeout, so it just fails quickly enough, except that I want to
use it.  That is why I want to fix it instead of just disable it (which
is what the Ubuntu wiki suggests).


>So, the simple answer is 
>mv /etc/rcS.d/S51ntpdate /etc/rc2.d/S51ntpdate
>  
>
>From what I have gathered so far, the rcS.d commands run in _every_
runlevel. Do I need to put it in rc[3-5].d also?

>The more complicated answer is to run ppp from ifupdown, so it starts
>earlier in the boot process.  
>
Which brings up another question.  With DOS, I could debug autoexec.bat
by commenting "echo off".  That way I could see which lines had
problems.  Is there a way to do that with init so that I can see exactly
which command is starting PPP?  It seems like ifupdown _is_ starting PPPoE.


>And that should do it.
>
>Take care,
>  
>
Thanks for helping. 

BTW, I highly recommend Brian Ward, HOW LINUX WORKS (2004 No Starch
Press), ISBN 1-59327-035-6.  I know it is subjective, but for most of
us, some books are too simplistic, others too obtuse.  For those of us
who know something, but not a lot, this book is just right.  He
discusses difficult topics, not just beginner stuff, but in an
articulate manner that is neither condescending nor presumes an MS in
CS.  The chapter on "How Linux Boots" is very helpful here.

-- 

_______________________________________
Art Alexion
Arthur S. Alexion LLC

PGP fingerprint: 52A4 B10C AA73 096F A661  92D2 3B65 8EAC ACC5 BA7A
The attachment -- signature.asc -- is my electronic signature; no need for alarm.
Info @ http://mysite.verizon.net/art.alexion/encryption/signature.asc.what.html

Key for signed PDFs available at
http://mysite.verizon.net/art.alexion/encryption/ArthurSAlexion.p7c
The validation string is TTJY-ZILJ-BJJG.
________________________________________

Attachment: signature.asc
Description: OpenPGP digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug