[kwlug-disc] somwehat confused about K* and S* /etc/init.d scripts in SuSE
john at netdirect.ca
john at netdirect.ca
Sat Sep 26 06:49:02 EDT 2009
Suse does this differently. As a side note on some unixes (hpux) each rc.d dir only contains the differences between run levels. In other words the startup has to go through rc1.d through rc5.d and run start scripts to boot to rl 5.
John Van Ostrand CTO, co-CEO
Net Direct Inc
564 Weber St. N. Unit 12
Waterloo, ON N2L 5C6
Ph: 519-883-1172 x5102
Ph: 866-883-1172 x5102
----- Original Message -----
From: "Robert P. J. Day" [rpjday at crashcourse.ca]
Sent: 09/26/2009 06:23 AM AST
To: KWLUG discussion list <kwlug-disc at kwlug.org>
Subject: [kwlug-disc] somwehat confused about K* and S* /etc/init.d scripts in SuSE
i'm reading someone else's courseware manual for SuSE 11, and the
discussion of how the start and kill scripts are invoked to change
runlevels just seems ... weird.
i've always believed that, for any single runlevel:
* the "K" scripts for that runlevel represent things to be killed
upon entering that runlevel
* the "S" scripts for that runlevel represent things to be started,
*also* upon entering that runlevel
in other words, a single runlevel directory (say /etc/init/rc5.d)
completely defines what should and should not be running in that
runlevel, based solely on its contents.
but the manual i'm reading claims:
"When the runlevel is changed, init calls the rc script with the new
runlevel as parameter (such as /etc/init.d/rc 3). The /etc/init.d/rc
script examines the /etc/init.d/ rccurrentrl.d/ and
/etc/init.d/rcnewrl.d/ directories and determines what to do.
For example, suppose you change from runlevel 5 to runlevel 3. There
are three possible scenarios that could occur as a result:
1) There is a Kxx link for a certain service in /etc/init.d/rc5.d/
and there is an Sxx link in /etc/init.d/rc3.d/ for the same service.
In this case, the service is neither started nor stopped because the
service should run in both runlevels. Therefore, the service’s script
in /etc/init.d/ is not called at all.
2) There is a Kxx link for a certain service in /etc/init.d/rc5.d/,
but there is no corresponding Sxx link in /etc/init.d/rc3.d/. In this
case, the script in /etc/init.d/service is called with the stop
parameter and the service is stopped.
3) There is an Sxx link in /etc/init.d/rc3.d/ and there is no
corresponding Kxx link for the service in /etc/init.d/rc5.d/. In this
case, the script in /etc/init.d/service is called with the start
parameter and the service is started."
again, that seems weird, in that you end up consulting the K
scripts of the runlevel you're *leaving*? and i notice that, in both
/of /etc/init.d/rc.d directories, there exist both scripts K01sshd
and S08sshd. start and kill scripts for the same service in the same
does SuSE just do things that differently from, say, fedora? or
have i misuderstood how this works all this time?
p.s. as another bit of weirdness, point 1) suggests that, if there's
a K script for the runlevel you're leaving, but an S script for the
runlevel you're entering, then you don't have to do anything with that
service. but what if you've *manually* stopped that service, then
change runlevels? since the above algorithm bases its decision
strictly on whether the symlink exists, that service won't be
restarted upon changing runlevels since no test is made as to whether
that service is still running.
i've never seen this particular explanation before, and it flies in
the face of everything i thought i knew.
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
-------------- next part --------------
kwlug-disc_kwlug.org mailing list
kwlug-disc_kwlug.org at kwlug.org
More information about the kwlug-disc