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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-16-2012, 02:07 AM
|
#1
|
|
Member
Registered: Sep 2011
Posts: 282
Rep: 
|
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?
|
|
|
|
05-16-2012, 03:11 AM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
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)
|
|
|
|
05-16-2012, 04:12 AM
|
#3
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
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?
|
|
|
|
05-16-2012, 05:00 AM
|
#4
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
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
|
|
|
|
05-16-2012, 12:12 PM
|
#5
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
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:
|
|
|
|
|
05-16-2012, 01:46 PM
|
#6
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
can I suggest you actually just READ those comments you pasted in? They are EXACTLY what you're asking about.
|
|
|
|
05-16-2012, 05:09 PM
|
#7
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,554
|
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.
|
|
|
|
05-17-2012, 03:20 AM
|
#8
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
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.
|
|
|
|
05-17-2012, 03:26 AM
|
#9
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
well seeing as there is literally no code in it to do anything other than set the runlevel... no.
|
|
|
|
05-17-2012, 03:29 AM
|
#10
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
Dear Kewpie,
So in this case who start the /etc/rc.d/rc n scripts then?
|
|
|
|
05-17-2012, 03:30 AM
|
#11
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
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.
|
|
|
|
05-17-2012, 03:31 AM
|
#12
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
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.
|
|
|
|
05-17-2012, 12:00 PM
|
#13
|
|
LQ Newbie
Registered: Feb 2012
Location: Raleigh, NC
Distribution: Debian & Fedora
Posts: 11
Rep:
|
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.
|
|
|
|
05-17-2012, 12:20 PM
|
#14
|
|
Member
Registered: Sep 2011
Posts: 282
Original Poster
Rep: 
|
Dear Great,
Thank you that is quite helpful to understand better about the process sequence.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:26 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|