LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 09-06-2006, 10:53 AM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
what is the scripts in /etc/init.d for?


don't know what it's for.
 
Old 09-06-2006, 11:04 AM   #2
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 250

Rep: Reputation: 34
These are all the startup scripts for the system. Depending on your distribution, there may be a softw link to various other directories to start and stop the functions. Redhat based distributions will place the links in /etc/rc.d/rcx.d The x will be replaced with the number 1 - 6, corresponding to a run level. If you boot to a graphical environment the default run level is 5. If you boot to a command prompt, the run level is probably 3; it is 2 in Debian based distributions.
 
Old 09-06-2006, 11:15 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
"man init.d" will tell you.

Edit: sorry, "man init.d" is probably missing on your Linux distribution, I was wrongly thinking that was a Solaris related question.

Last edited by jlliagre; 09-06-2006 at 11:25 AM.
 
Old 09-06-2006, 12:59 PM   #4
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Original Poster
Rep: Reputation: 30
so basically every time you boot, first the rc.d directory is checked to see what to load, then the scripts in the /etc/init.d is to load the program?

Last edited by blackzone; 09-06-2006 at 01:01 PM.
 
Old 09-06-2006, 01:26 PM   #5
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 250

Rep: Reputation: 34
You are close. If you take a look at my abbreviated answer, it alluded to run levels. You can find your default run level from the /etc/inittab file. It will list, among other things, the default run level. Let us assume you are running a Debian, or derivative distribution, and generally come up at the command line prompt. The default run level is 2. The scripts that would get run are located in /etc/rc.d/rc2.d. These 'scripts' are really links to similarly named scripts in the /etc/init.d directory. It is the mechanism that allows a subset of all scripts to be run at a specific run level. Slackware choses a bsd type of approach. The scripts to be run are stored in the /etc/rc.d directory.
 
Old 09-06-2006, 04:48 PM   #6
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Rep: Reputation: 15
more init.d questions

Hey,

I'm running a distro called Knoppmyth, and I'm studying the boot process.

In my /etc/inittab script it reads:

Quote:
10:0:wait:/etc/init.d/rc 0
11:1:wait:/etc/init.d/rc 1
12:2:wait:/etc/init.d/rc 2
and so on ...
From this I expected that there would be directories named /etc/init.d/rc 0, and /etc/init.d/rc 1, (and so on). But these directories do not exist on my machine.

However, there are /etc/rc0.d, /etc/rc1.d , (and so on) directories. These directories are filled with K** and S** links to various init.d/* files. (Example: S35networking -> ../init.d/networking)

Long story short, because of inittab's references, I expected to find a whole bunch of S... and K... files in the /etc/init.d/rc # directories, not in the /etc/rc#.d directories.

I don't understand why a file as rudimentry as inittab would reference several files that do not exist? And I don't understand how the machine knows to use the etc/rc#.d directories. (I might be incorrectly assuming that the /etc/rc#.d directories are reference at boot.)

Is this typical, or is this a particular to Knoppmyth -- which is a specialized distro?
 
Old 09-06-2006, 09:16 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,308

Rep: Reputation: 768Reputation: 768Reputation: 768Reputation: 768Reputation: 768Reputation: 768Reputation: 768
Code:
/etc/init.d/rc 0
#Not the same as
/etc/init.d/rc0
Note the space. This actually runs the file /etc/init.d/rc with an argument of 0.
 
Old 09-06-2006, 11:10 PM   #8
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Rep: Reputation: 15
hmmm... that does make a difference. So /etc/init.d/rc 0 references (perhaps I could use the term "calls") /etc/rc0.d via the 0 argument. That makes sense. Ah! that feels better. Thanks
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
init scripts lvgandhi Debian 2 10-11-2005 02:44 AM
Customize my init scripts Spack971 Slackware 16 07-04-2005 05:37 PM
New init scripts? xconspirisist Fedora 9 12-09-2004 11:41 AM
Scripts in /etc/rc.d/init.d correro Linux - General 1 03-13-2003 09:47 PM
Slackware init scripts. jpweston Slackware 1 04-17-2002 11:52 PM


All times are GMT -5. The time now is 06:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration