Linked by David Adams on Sat 17th May 2008 03:39 UTC, submitted by IdaAshley
Thread beginning with comment 314747
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: Comment by sonic2000gr
by sonic2000gr on Sun 18th May 2008 20:52
in reply to "RE[2]: Comment by sonic2000gr"
I have seen these rcX directories on some Linux distrobutions, and my debian installation has a init.d/ and several rcX.d/ direcotries in /etc.
In these rc0,1,2,3,4,5,6.d/ direcories are symlinks to scripts in /etc/init.d/, and it seems to me at least that this system uses both "rc.d/ entries" and runlevels, so I dont really get the destinction between rc-directories ans runlevels...
Care to explain?
In these rc0,1,2,3,4,5,6.d/ direcories are symlinks to scripts in /etc/init.d/, and it seems to me at least that this system uses both "rc.d/ entries" and runlevels, so I dont really get the destinction between rc-directories ans runlevels...
Care to explain?
Have a look at your /etc/inittab file. You will find a line that says something like:
id:2:initdefault:
This means that when you system, starts normally, it enters runlevel 2. Now move a few lines down, and you will see this:
l2:2:wait:/etc/init.d/rc 2
This basically means the rc script will execute the scripts in /etc/rc2.d
Now, have a look at the scripts in /etc/rc2.d:
An example:
S20ssh -> ../init.d/ssh
this starts the ssh server. Obviously it is just a link to a script in init.d, but the rc script reads this from /etc/rc2.d. The name and number are significant too. The 20 signifies the order of the script. For example this:
S19nis -> ../init.d/nis
executes before ssh. The "S" in the name means the rc script will call this script with a "start" argument. Essentially, S20ssh is like writing:
/etc/init.d/ssh start
If it had a "K" instead of an "S" it would be called with a "stop" argument.
Have a look at your /etc/rc1.d scripts. These are called when you switch to single user mode (runlevel 1). You will see that quite a few services are stopped (or "K"illed) when entering runlevel 1:
K80nfs-kernel-server -> ../init.d/nfs-kernel-server
this calls /etc/init.d/nfs-kernel-server stop, so NFS sharing is stopped when you enter single user mode.
There are also two "special" (or transient) runlevels, namely 0 (for shutdown) and 6 (for reboot). Have a look at the scripts there too.
After all, it is not a difficult system






Member since:
2006-12-18
Doc Pain wrote: "The alternative to the runlevels is the use of an rc script and the rc.d/ entries, such as it is the case in the FreeBSD OS. Refer to "man boot", "man loader", "man init" and "man rc" for further education."
I have seen these rcX directories on some Linux distrobutions, and my debian installation has a init.d/ and several rcX.d/ direcotries in /etc.
In these rc0,1,2,3,4,5,6.d/ direcories are symlinks to scripts in /etc/init.d/, and it seems to me at least that this system uses both "rc.d/ entries" and runlevels, so I dont really get the destinction between rc-directories ans runlevels...
Care to explain?
Edited 2008-05-18 19:38 UTC