Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-20-2010, 11:36 AM   #1
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?

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

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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.


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 AM.

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