LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2003, 11:49 AM   #1
roshko
LQ Newbie
 
Registered: Aug 2003
Location: London, UK
Distribution: SuSE 8.2 Pro
Posts: 5

Rep: Reputation: 0
Question What is the naming convention for files in rcX.d?


Hi all,

Just wondering what the logic is behind the names of the files in the /etc/init.d/rcX.d directories (X=0..6).

From my research so far, I have gathered the following information. Can anyone confirm if my information is correct, and/or fill in the missing details?

* The filenames are of the form S<N><service> or K<N><service>, where N is some number (e.g. S72autofs or K50inetd).

* The files are (usually) symbolic links to scripts in /etc/init.d.

* The "S" scripts are run upon starting a run level. They are run in order of their number (hence S05foo is run before S06bar).

* The "K" scripts are run when changing run levels. So, if I am going from run level A to run level B, the "K" scripts in rcA.d will be run, in order of their numbers.

Is that more or less it? Is anything in the above wrong or not quite right?

What I still don't know though, is how one chooses the numbers.

For example (a real example -- this is why I am looking into this in the first place!) take autofs: Currently, autofs is not being loaded upon booting my SuSE 8.2 PC. So, every time I boot, I have to manually do a /etc/init.d/autofs start (as root) to get it going. I would like to have this done at boot instead.

I have determined that I'll need a line in /etc/init.d/rc5.d (and possibly rc3.d) for this, of the form S<N>autofs. But how do I know what value to choose for N? Can it be anything, or is autofs picky in terms of the order in which it is loaded? And then what about the corresponding K files?

Google searching has shown me that S72autofs and K08autofs are popular choices for Red Hat distros, but why? Can the same be used for SuSE 8.2?

Putting autofs aside for the moment, how would I name the S & K files for arbitrary services?

Thanks to all in advance!

In case it helps: I am running SuSE 8.2 Pro and use Enlightenment windows manager.

Cheers,
Michael
 
Old 09-01-2003, 01:14 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Its also Distro specific on how they want to name the rc.X scripts. Some are more complicated than others.

Like Slackware you'll have your runlevel scripts that call upon the other scripts:

rc.S
rc.M
rc.K
rc.4
rc.6
rc.0

And then you'll have the other scripts that are named by the type of service its starting or stopping.

rc.modules
rc.samba
rc.httpd
rc.nfsd
rc.inet1
rc.inet2

And so on....
This is one of the reasons I love Slackware, it has the most simplistic startup scripts, that are easy to understand and edit accordingly.

But I think from reading your post that you got it down, how it works, etc. I get confused though sometimes as I'm use to Slackware and then looking at the Redhat or Mandrake startup scripts, I get confused in finding what I need to edit, etc.
 
Old 09-01-2003, 04:41 PM   #3
rahulsundaram
Member
 
Registered: May 2003
Location: India
Distribution: Knoppix, RedHat
Posts: 246

Rep: Reputation: 30
hi

you dont need to add or removing scripts by messing up with the directory. dont worry abt k n or whatever. just use a front end

redhat has these two stuff

ntsysv
chkconfig

i am not sure what suse does. check their extensive docs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb naming convention hoover93 Linux - Hardware 5 10-19-2005 10:18 PM
script finding files, placing them and naming the TroelsSmit Linux - Networking 0 11-18-2004 02:21 PM
fonts.scale/fonts.dir: Naming convention kaon Linux - General 0 08-09-2004 05:02 AM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 02:08 PM
A small question in naming convention mnguyen Linux - Software 1 04-17-2004 03:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration