LinuxQuestions.org
Register a domain and help support LQ
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 04-20-2010, 11:36 AM   #1
prasadcm
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
Why are there four different rc scripts directories?


There is /etc/rc.d/rcN.d --> where N=0-6.
There is /etc/rc.d/init.d
There is /etc/init.d, and finally
there is /etc/rcN.d --> where N=0-6.

Why so many? I know init looks at inittab and executes scripts in /etc
rc.d/rcN.d...depending on the run level. But what are so many links to
other directories for? When are they used and by what process?


Thanks
Prasad.
 
Old 04-20-2010, 01:42 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
Basics in init scripts:
init.d = Directory where the base files are used for startup and shutdown.

rcN.d = Directory that has copies of or links back to the base files in init.d specific to the run level represented by "N". These directories will have files in them in the form of S###script and K###script where S = Start, K = Kill (Stop), ### = the order in which to start or stop and script is the name of the script in init.d.


The reason you're not just seeing two directories though is due to the fact that different people have different ideas about the most appropriate place for the above. Therefore some people just make symbolic links so you can find them wherever you look.

If you look at your /etc/init.d and your /etc/rc.d/init.d you'll likely see one of them is a symbolic link to the other.

Similarly if you look at /etc/rcN.d and /etc/rc.d/rcN.d you'll see one of them is a symbolic link to the other.

This was part of the AT&T UNIX System V Release 4 (SVR4) way of doing things. HP-UX for example actually has init.d under /sbin instead of the directories you mention.

Last edited by MensaWater; 04-20-2010 at 01:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
users accessing directories,files using php scripts ckob Linux - Security 3 03-14-2008 09:06 AM
Terminal mode changing directories and opening shell scripts fillister Ubuntu 8 11-26-2007 07:54 PM
Startup scripts in rcn.d directories correro Linux - Newbie 1 01-20-2006 01:20 AM
Copying linked files, replacing directories in bash scripts? ta0kira Programming 2 10-10-2004 05:46 AM
running cgi scripts in other directories init-5 Linux - Software 2 09-16-2003 04:01 PM


All times are GMT -5. The time now is 06:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration