LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 12-10-2009, 03:33 AM   #1
himanshu1987
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Rep: Reputation: 0
working of init command


i would like to know how init works?
i mean the proper working of init command like what happen when init switches b/w two runlevels.
please discribe the whole scripting of init that is written in
vim /etc/rc.d/init.d/functions file
please discribe the script of init

Last edited by himanshu1987; 12-11-2009 at 10:07 AM. Reason: because i didn't satisfy ith the answer
 
Old 12-10-2009, 03:54 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
As far as how init works under the covers you would need to look at the source, on Fed 11 init is provided by the upstart package. If you determine which package provides init on your platform you can download the source version to cure your insomnia.

Heres a quick overview...

Executable scripts are kept under /etc/rc.d/init.d/, symbolic links to the init scripts are created under the various runlevel directories ( /etc/rc2.d, /etc/rc3.d ...) where the name of the symlink is important. A symlink starting with 'S' will be Started in that runlevel, a symlink starting with 'K' will be Killed in that runlevel. Following the 'S' or 'K' is a 2 digit number, this number determines the order that the service/daemon will be started or killed...

eg. S25pcscd will be 'S'tarted before S26acpid

cheers
 
0 members found this post helpful.
Old 12-11-2009, 10:01 AM   #3
himanshu1987
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0
history of init comman

hello,
i would like 2 know the history of init coomand means when it was added in linux, who invented it.
so give me proper answer of this....
 
Old 12-11-2009, 10:09 AM   #4
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
http://tinyurl.com/yed68ny
 
1 members found this post helpful.
Old 12-11-2009, 10:54 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
himan*;

Please do not edit your original post based on an answer you have received:

Quote:
Last edited by himanshu1987; Today at 08:07 AM.. Reason: because i didn't satisfy ith the answer
No-one is going to be able to see what you have changed and why. Please respond to the thread with any additional questions, clarification, etc.
 
1 members found this post helpful.
Old 12-11-2009, 10:56 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
This is closely-related to your other thread, so I am going to merge them.

The combination of the two questions looks very much like homework---please give us some more context for the questions.
 
1 members found this post helpful.
Old 12-15-2009, 01:02 AM   #7
himanshu1987
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
This is closely-related to your other thread, so I am going to merge them.

The combination of the two questions looks very much like homework---please give us some more context for the questions.

its not my home work i am just working on it to get to know how init works that i know it is a process control intilization.but i donot know how it control the process.so for that i want to know the working of it
and i also want to implement some changes in the script to make it more compatible for new users
for that i want to know the proper working of init command
i am witing to your answer.
 
Old 12-15-2009, 02:08 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
We cannot answer such vague questions here. Full answers to those questions is a book, not an LQ post! Full answers can anyway be found on the net -- starting with the links already given. After learning from those links you will know enough to netsearch more.

LQ is good at answering specific questions. After you have read and netsearched and read more, then you will have specific questions.

You can learn about the difference between the init process, the init command and init scripts. You will need to know about Linux processes to understand those things. There are some links to learn about processes in this LQ post
Quote:
Originally Posted by himanshu1987 View Post
i am witing to your answer.
What is the intended effect of that sentence? What do you think the likely effect will be? Are the answers different?
 
0 members found this post helpful.
Old 12-15-2009, 02:12 AM   #9
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
I too, would like to know exactly how the runlevel stuff is set up and handled by the system.

This is what I know - you define runlevels to the kernel, which is - collections of processes that will be run when that runlevel is entered. When you type, eg. "init 3", it (I don't know what or how) checks which processes need to be run for that runlevel, and runs their startup scripts, and the shutdown scripts of all the processes that need to be shut off.

I've always thought this was one of the coolest features of Linux - but what I really wanted to do of course was to enter my OWN programs that would be run for a particular runlevel, but the distros, trying to keep the "professional" users, and not hackers, in mind, make this unnecessarily difficult, and ultimately I gave up, and just started following what it said in /etc/inittab - this runlevel for X, that one for terminal, etc. etc.

This is quite sad.... , I'd love to know how to run whatever programs I want to when I type "init 3" on Fedora, say - can anybody help me?
 
Old 12-15-2009, 02:18 AM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by resetreset View Post
I've always thought this was one of the coolest features of Linux - but what I really wanted to do of course was to enter my OWN programs that would be run for a particular runlevel, but the distros, trying to keep the "professional" users, and not hackers, in mind, make this unnecessarily difficult, and ultimately I gave up, and just started following what it said in /etc/inittab - this runlevel for X, that one for terminal, etc. etc.
Seems you've been using the "wrong" distros ;-)

In Debian, by default, the run levels 2 through 5 are all the same. The admin is then free to customize them to their liking.

Cheers,

Evo2.
 
Old 12-15-2009, 02:24 AM   #11
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
The way I go about if i want to find out anything I'm curious on linux is like this.

Code:
$ whatis init
init (8)             - process control initialization
Code:
$ apropos init
delscreen (3ncurses) - curses screen initialization and manipulation routines
endwin (3ncurses)    - curses screen initialization and manipulation routines
event_init (3) [event] - execute a function when a specific event occurs
event_initialized (3) [event] - execute a function when a specific event occurs
event_priority_init (3) [event] - execute a function when a specific event occurs
evtimer_initialized (3) [event] - execute a function when a specific event occurs
field_init (3form)   - set hooks for automatic invocation by applications
form_init (3form)    - set hooks for automatic invocation by applications
groupmod (8)         - modify a group definition on the system
init (8)             - process control initialization
init_color (3ncurses) - curses color manipulation routines
init_pair (3ncurses) - curses color manipulation routines
initramfs-tools (8)  - an introduction to writing scripts for mkinitramfs
initramfs.conf (5)   - configuration file for mkinitramfs
applications
more output...
shortened...
Code:
$ man init

INIT(8)                                                    Linux System AdministratorÔs Manual                                                    INIT(8)

NAME
       init, telinit - process control initialization

SYNOPSIS
       /sbin/init [ -a ] [ -s ] [ -b ] [ -z xxx ] [ 0123456Ss ]
       /sbin/telinit [ -t SECONDS ] [ 0123456sSQqabcUu ]
       /sbin/telinit [ -e VAR[=VAL] ]

DESCRIPTION
   Init
       Init  is  the  parent  of  all processes.  Its primary role is to create processes from a script stored in the file /etc/inittab (see inittab(5)).
       This file usually has entries which cause init to spawn gettys on each line that users can log in.  It also controls autonomous processes required
       by any particular system.
Three words that tell everything about linux

apropos whatis man
 
Old 12-15-2009, 07:44 AM   #12
himanshu1987
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
We cannot answer such vague questions here. Full answers to those questions is a book, not an LQ post! Full answers can anyway be found on the net -- starting with the links already given. After learning from those links you will know enough to netsearch more.

LQ is good at answering specific questions. After you have read and netsearched and read more, then you will have specific questions.

You can learn about the difference between the init process, the init command and init scripts. You will need to know about Linux processes to understand those things. There are some links to learn about processes in this LQ post
What is the intended effect of that sentence? What do you think the likely effect will be? Are the answers different?
oh really i can get the proper answer of init on internet.
if u don't know any thing about initso better be u don't give any answer to some one.
all right
 
Old 12-15-2009, 07:50 AM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by himanshu1987 View Post
oh really i can get the proper answer of init on internet.
if u don't know any thing about initso better be u don't give any answer to some one.
all right
I am not sure what you are saying here---as far as I can tell, catkin gave you a perfectly reasonable answer.

1. Did you look at the link he provided?

2. What is your current status with your issue? Do you have more specific questions?

And, please: you, not u
 
  


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
INIT 3 not working. waelaltaqi Linux - General 5 11-10-2006 06:46 PM
su command in init script blocks RachunZero Linux - General 6 08-22-2006 04:30 AM
init cannot execute /command/svscanboot puter_gk Linux - Networking 1 02-25-2005 11:36 AM
Working with init 3 robertmarkbram Linux - Software 1 11-23-2003 11:29 PM
using init command reetep Linux - Newbie 7 10-27-2003 03:11 PM


All times are GMT -5. The time now is 10:57 PM.

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