the difference between the /etc/rc?.d directories
Hi all,
i do not see yet clearly the difference between the many
/etc/rc?.d directories. I know they are read by their respective /sbin/rc?
But if i type:
ls /etc/rc*/*ssh*
i will get:
rc0.d/K03sshd* rc1.d/K03sshd* rc2.d/K03sshd* rc3.d/S89sshd* rcS.d/K03sshd*
Which should i stop/start manually if i need?
The same situation is for many other services.
Also, what means the first capital letters of each script?
Thanks a lot for any tip ...
Message was edited by:
tuneler
null
[562 byte] By [
tunelera] at [2007-11-27 0:30:04]

# 2
Ok,
about the first capital letter, i got it.
But in my Solaris 9 they are not symlinks
between the /etc/init.d and the /etc/rc?.d dirs.
They are just identical scripts.
It still looks strange for me that a sctipt starting with S,
say /etc/rc3.d/S89sshd accepts start and stop as
arguments, as well as the script /etc/rc0.d/K03sshd
(they are identical scripts :-)
So why use all these script files, with different first letters,
in different directories ... if they are all the same?
Ok, i know the answer, we can use them the way we want.
But is looks like a confusing system for me.
# 3
> Ok,
> about the first capital letter, i got it.
> But in my Solaris 9 they are not symlinks
> between the /etc/init.d and the /etc/rc?.d dirs.
> They are just identical scripts.
If it came with solaris, they are links. Not symbolic links but multiple hard links (examine the 'nlinks' field in 'ls -l' output.
But that doesn't matter. In normal setup, they are all the same script. Not that they have to be, but it's less confusing that way.
> It still looks strange for me that a sctipt starting
> with S,
> say /etc/rc3.d/S89sshd accepts start and stop as
> arguments, as well as the script /etc/rc0.d/K03sshd
> (they are identical scripts :-)
> So why use all these script files, with different
> first letters,
> in different directories ... if they are all the
> same?
It lets someone write one script that understands the logic of the process and do the right thing. Then the script can be put in any run level.
If you had multiple scripts in different places, then you'd have to edit each one if you had a bug or needed to change some information in the script. By making them all links, you just have to edit it in one place.
The first letters and the locations control when and how the script is invoked, while the contents of the script control what it does when it is run.
--
Darren