Linux - NewbieThis 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
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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...
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.
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
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?
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?
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.
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.
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.