LinuxQuestions.org
Review your favorite Linux distribution.
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 05-16-2012, 02:07 AM   #1
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Rep: Reputation: Disabled
Difference between /etc/init.d/ and innitab


Dear All,
I am confuse where some programme start with /etc/init.d/ and some start in inittab and some what the /etc/init.d/rc. From what I understand inittab is for the on boot process to start automatically is it?
 
Old 05-16-2012, 03:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
inittab defines, amongst a few other things like starting console processes, what the runlevel is, and once the runlevel is defined, the scripts in /etc/rc.d/, which are symlinks onto the /etc/init.d scripts are executed accordingly. (Well, for sysVinit at least, changed somewhat for systemd and other newer systems, but the principle still holds)
 
Old 05-16-2012, 04:12 AM   #3
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Kewpie,
So when the system load it will first look into inittab is it? So in inittab you do find configuration files for other or just console processes? Are these proceses also link to /etc/init.d? I notice some services are run as /etc/init.d/service start ( this will run only if there is a file in /etc/init.d right? Then some are run on inittab what is their difference?
 
Old 05-16-2012, 05:00 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
just LOOK at the inittab file:

Code:
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
so if it's runlevel 3 go run the rc scripts for runelvel 3 and so on...

services don't run from inittab, it starts the process to run the services as a whole
 
Old 05-16-2012, 12:12 PM   #5
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Kewpie,
This is what I see in my inittab. So it just have this id:3:initdefault: not pointing to any of the rc ? I dont quite get this "services don't run from inittab, it starts the process to run the services as a whole" Which process does it start? So when boot first it come to inittab is it?

Quote:
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:
 
Old 05-16-2012, 01:46 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
can I suggest you actually just READ those comments you pasted in? They are EXACTLY what you're asking about.
 
Old 05-16-2012, 05:09 PM   #7
sundialsvcs
Senior Member
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,554

Rep: Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640
As previously noted: the inittab file is what is consulted ... and its contents are what point the system to the various directories and their contents.

The script /etc/rc.d/rc n is what does it.
 
Old 05-17-2012, 03:20 AM   #8
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Sun,
If I read this "inittab is only used by upstart for the default runlevel.". So in this case it does not call the script /etc/rc.d/rc n am I right here? Thank you.
 
Old 05-17-2012, 03:26 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
well seeing as there is literally no code in it to do anything other than set the runlevel... no.
 
Old 05-17-2012, 03:29 AM   #10
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Kewpie,
So in this case who start the /etc/rc.d/rc n scripts then?
 
Old 05-17-2012, 03:30 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
upstart, but I don't know how upstart itself starts. It'll be pretty straight forward I'm sure, I just don't know myself.
 
Old 05-17-2012, 03:31 AM   #12
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Chris,
So I got it now this inittab starts the upstart and then that starts the rest of the script right. Never mind I will look further into upstart.
 
Old 05-17-2012, 12:00 PM   #13
greatbear
LQ Newbie
 
Registered: Feb 2012
Location: Raleigh, NC
Distribution: Debian & Fedora
Posts: 11

Rep: Reputation: 0
Newbie14, the executable that actually starts rc.d/rc scripts is called Init. Init can be considered the 'Main' function in the linux kernel, because it is usually the very first program. Here is a wikipedia article about it. Init reads the innitab file, and then it proceeds to the other configuration files. It also starts up scripts which are processed by executing shell programs such as BASH, PERL and PYTHON.
 
Old 05-17-2012, 12:20 PM   #14
newbie14
Member
 
Registered: Sep 2011
Posts: 282

Original Poster
Rep: Reputation: Disabled
Dear Great,
Thank you that is quite helpful to understand better about the process sequence.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
init.d difference? yogaboy Linux - General 3 12-18-2006 11:36 AM
difference between /etc/init.d/rc#.d and /etc/rc.d/ zhimsel Linux - General 5 10-26-2006 04:47 PM
Difference between /etc/rc.d/init.d/ and /etc/init.d/ techstar25 Red Hat 2 10-05-2006 04:20 AM
Difference between init and others shipon_97 Linux - Newbie 3 03-04-2006 11:12 AM
INIT: no innitab file found behmjose Linux From Scratch 3 12-17-2003 05:17 AM


All times are GMT -5. The time now is 03:26 AM.

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
Open Source Consulting | Domain Registration