On 2011-01-07 10:36, hcvv wrote:
>
> Carlos,
>
> Your remark about the INIT INFO section is correct, but this section
> only serves to give the script a correct sequence number in the links in
> the- rc?.d- directories. And that is done by the configuring tool (e.g.
> YaST) that understands these INIT INFO section at configuring time. It
> is not used at boot/shutdown time. Thus how could this work configuring
> it for runlevel 2 in the -rc2.d- directory? Would it create a sort of
> failure? And would that failure influence the links in the- rc3.d -and-
> rc5.d- directoruies? I do not know.
It works, believe me 
YaST uses insserv to “install” those scripts. Or you can use “chkconfig”,
which also uses insserv. This “insserv” knows how to read the INIT INFO
section - it is a comment to bash, thus ignored, but it is interpreted by
insserv.
How? Well, traditionally by creating those symlinks in /etc/init.d/rc3.d/
and the rest directories, with names that start with S00, S01, S02, etc
(and K00, K01, for the halt sequence). On boot, those scripts are started
in order, numerical order. Simply by having “S02network” and “S12apache2”,
it is ensured that network is started before apache.
However, SUSE uses an improvement on this: makefile like configuration
files: depend.boot .depend.halt .depend.start .depend.stop. These allow
more complex dependency control that the links, and also allow parallel
booting. The links are in fact now ignored: if you create a link to a
script and put it there, it doesn’t run.
You can see the code in “/etc/init.d/rc”.
So the thing is that during boot on each runlevel the correct scripts are
started in the correct order. It simply works, it is a very much thought
about and engineered part of our distro 
(and about to change for 11.4 or perhaps delayed to 12.0)
So, what happens in runlevel 2? Well, the network service is started in
level 2:
Telcontar:~ # chkconfig -l network
network 0:off 1:off 2:on 3:on 4:off 5:on 6:off
So apache can be configured there. But I think it is just the local
loopback (lo) networking.
Influence on the other levels? Limited. Links created in one level do not
affect other levels. But if you start on runlevel 2, then go to 3, services
that were previously started are not restarted again. This I think was an
improvement that appeared on I don’t remember what version.
What happens to apache started in runlevel 2?
I do not know. Network was started in level 2, the script is there, but I
suppose, educated guess, that only the local (lo) interface. On switch to
runlevel 3, network should really be started, and those services that need
it should restart again (if they are already running). I don’t know how,
if, the system figures this out, and I’m not going to test that hypothesis,
it would kill my session 
Oh, right, I could use a VM. But I’m hungry and I have to cook it 
> Also, the fact that the OP apparently did do at least some things
> manualy instead of trusting the installed scripts and YaST, how can we
> know he didn’t do much more things manualy? Especialy as until now he
> does not explain why he differed from the normal way of working, leaving
> us to guess what he did. He can equaly well use a different-
> init.d/apache2- script from the one you cite from.
That is so, yes.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)