LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   working of init command (https://www.linuxquestions.org/questions/linux-newbie-8/working-of-init-command-774684/)

himanshu1987 12-10-2009 03:33 AM

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

kbp 12-10-2009 03:54 AM

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

himanshu1987 12-11-2009 10:01 AM

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....

kdelover 12-11-2009 10:09 AM

http://tinyurl.com/yed68ny

pixellany 12-11-2009 10:54 AM

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.

pixellany 12-11-2009 10:56 AM

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.

himanshu1987 12-15-2009 01:02 AM

Quote:

Originally Posted by pixellany (Post 3787957)
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.

catkin 12-15-2009 02:08 AM

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 (Post 3791865)
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?

resetreset 12-15-2009 02:12 AM

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?

evo2 12-15-2009 02:18 AM

Quote:

Originally Posted by resetreset (Post 3791926)
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.

zhjim 12-15-2009 02:24 AM

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

himanshu1987 12-15-2009 07:44 AM

Quote:

Originally Posted by catkin (Post 3791919)
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

pixellany 12-15-2009 07:50 AM

Quote:

Originally Posted by himanshu1987 (Post 3792233)
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


All times are GMT -5. The time now is 01:32 AM.