Sponsored Content
Top Forums UNIX for Advanced & Expert Users Does inittab needs system restart? Post 302528932 by Skrynesaver on Wednesday 8th of June 2011 09:10:47 AM
Old 06-08-2011
Code:
man telinit

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

inittab solaris

Hi! Is it possible to add more ttys in Solaris, like with inittab in Linux? I want to switch between the ttys with Alt F1+F2+F3 .... like Linux does. How can i do this? (1 Reply)
Discussion started by: donald1111
1 Replies

2. AIX

Execute a command at the system restart

Hi Folks, I have an AIX server and I would like the server to run the command saprouter -r at every system restarts. It needs to be run by a specific user. How would I do that? Thanks!!! (1 Reply)
Discussion started by: brookingsd
1 Replies

3. Solaris

inittab in Solaris 10

Hi, In Solaris 9 and below release we are using the rc script in inittab. I don't have much idea abt inittab in Solaris. In Solris 9 and below: We use rc3 script to start up the server. And we run database script before the rc3. os:23:respawn:/etc/init.d/database start >/dev/null 2>&1... (7 Replies)
Discussion started by: kalpeer
7 Replies

4. Solaris

inittab entry does not works

Hi, I have a solaris 10 server,which has a process running that communicates with other system.I have made following entry in the inittab file. PM15:s12345:respawn:/ncm/bin/communicator PM15 : Unique process ID s12345 : run levels respawn : if anytime the process... (2 Replies)
Discussion started by: asalman.qazi
2 Replies

5. UNIX for Dummies Questions & Answers

What breaks inittab

Today there was a situation where processes running from inittab was broken. Can someone help me understand, how to find out, who might have stopped those processes? Or how does it get broken? G (2 Replies)
Discussion started by: ggayathri
2 Replies

6. AIX

problem to restart services from /etc/inittab in AIX6.1

hello, i have an AIX6.1.7.2 machine that it was upgraded recently from AIX5.3.9.4. when i kill system services that should restart automatically like /usr/sbin/cron it doesnt start. i checked my /etc/inittab file and i confirmed that this service is in respawn status so when i kill this process... (2 Replies)
Discussion started by: omonoiatis9
2 Replies

7. UNIX for Dummies Questions & Answers

Inittab configuration

I am installing BusyBox on a device that does not have keyboard or serial connection, so I log into the system with SSH. I am in doubt about what to put in the inittab file. This is the content of the file: ::sysinit:/etc/init.d/rcS ::respawn:/bin/login ::shutdown:/sbin/swapoff -a... (1 Reply)
Discussion started by: richard78
1 Replies

8. Linux

How to add a entry in inittab?

Hi All, I am booting by Linux box with the run level 3 and it gets booted successfully. I want to execute a script once the system is up and running in the run level 3. I was trying to add a entry to /etc/inittab to execute my script once the system is up. I have added the below... (5 Replies)
Discussion started by: kalpeer
5 Replies

9. Shell Programming and Scripting

Script calling by inittab

Hi to all , i wrote a small script and i add it to inittab to start the script during Startup. The script works fine , if i call it from the prompt but if it is call from inittab it is runnng too but it does not recognize system variable like USER , LOGNAME. Since i running out of ideas i... (12 Replies)
Discussion started by: Nadielosabra
12 Replies

10. Red Hat

No VolGroup00 found after restart of the system

I am facing the following issue after giving a restart (init 6) of my RHEL 5.9 system. As a result,the system is not starting after a restart. Can somebody help me to trouble shoot the issue. Red Hat nash version 5.1.19.6 starting Reading all physical volumes. This may take a while... ... (7 Replies)
Discussion started by: Anjan Ganguly
7 Replies
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 init- tab(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. RUNLEVELS
A runlevel is a software configuration of the system which allows only a selected group of processes to exist. The processes spawned by init for each of these runlevels are defined in the /etc/inittab file. Init can be in one of eight runlevels: 0-6 and S or s. The run- level is changed by having a privileged user run telinit, which sends appropriate signals to init, telling it which runlevel to change to. Runlevels 0, 1, and 6 are reserved. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to get the system down into single user mode. Runlevel S is not really meant to be used directly, but more for the scripts that are exe- cuted when entering runlevel 1. For more information on this, see the manpages for shutdown(8) and inittab(5). Runlevels 7-9 are also valid, though not really documented. This is because "traditional" Unix variants don't use them. In case you're curious, runlevels S and s are in fact the same. Internally they are aliases for the same runlevel. BOOTING
After init is invoked as the last step of the kernel boot sequence, it looks for the file /etc/inittab to see if there is an entry of the type initdefault (see inittab(5)). The initdefault entry determines the initial runlevel of the system. If there is no such entry (or no /etc/inittab at all), a runlevel must be entered at the system console. Runlevel S or s bring the system to single user mode and do not require an /etc/inittab file. In single user mode, /sbin/sulogin is invoked on /dev/console. When entering single user mode, init initializes the consoles stty settings to sane values. Clocal mode is set. Hardware speed and hand- shaking are not changed. When entering a multi-user mode for the first time, init performs the boot and bootwait entries to allow file systems to be mounted before users can log in. Then all entries matching the runlevel are processed. When starting a new process, init first checks whether the file /etc/initscript exists. If it does, it uses this script to start the process. Each time a child terminates, init records the fact and the reason it died in /var/run/utmp and /var/log/wtmp, provided that these files exist. CHANGING RUNLEVELS
After it has spawned all of the processes specified, init waits for one of its descendant processes to die, a powerfail signal, or until it is signaled by telinit to change the system's runlevel. When one of the above three conditions occurs, it re-examines the /etc/inittab file. New entries can be added to this file at any time. However, init still waits for one of the above three conditions to occur. To provide for an instantaneous response, the telinit Q or q command can wake up init to re-examine the /etc/inittab file. If init is not in single user mode and receives a powerfail signal (SIGPWR), it reads the file /etc/powerstatus. It then starts a command based on the contents of this file: F(AIL) Power is failing, UPS is providing the power. Execute the powerwait and powerfail entries. O(K) The power has been restored, execute the powerokwait entries. L(OW) The power is failing and the UPS has a low battery. Execute the powerfailnow entries. If /etc/powerstatus doesn't exist or contains anything else then the letters F, O or L, init will behave as if it has read the letter F. Usage of SIGPWR and /etc/powerstatus is discouraged. Someone wanting to interact with init should use the /dev/initctl control channel - see the source code of the sysvinit package for more documentation about this. When init is requested to change the runlevel, it sends the warning signal SIGTERM to all processes that are undefined in the new runlevel. It then waits 5 seconds before forcibly terminating these processes via the SIGKILL signal. Note that init assumes that all these pro- cesses (and their descendants) remain in the same process group which init originally created for them. If any process changes its process group affiliation it will not receive these signals. Such processes need to be terminated separately. TELINIT
/sbin/telinit is linked to /sbin/init. It takes a one-character argument and signals init to perform the appropriate action. The follow- ing arguments serve as directives to telinit: 0,1,2,3,4,5 or 6 tell init to switch to the specified run level. a,b,c tell init to process only those /etc/inittab file entries having runlevel a,b or c. Q or q tell init to re-examine the /etc/inittab file. S or s tell init to switch to single user mode. U or u tell init to re-execute itself (preserving the state). No re-examining of /etc/inittab file happens. Run level should be one of Ss0123456 otherwise request would be silently ignored. telinit can tell init how long it should wait between sending processes the SIGTERM and SIGKILL signals. The default is 5 seconds, but this can be changed with the -t option. telinit -e tells init to change the environment for processes it spawns. The argument of -e is either of the form VAR=VAL which sets vari- able VAR to value VAL, or of the form VAR (without an equality sign) which unsets variable VAR. telinit can be invoked only by users with appropriate privileges. The init binary checks if it is init or telinit by looking at its process id; the real init's process id is always 1. From this it follows that instead of calling telinit one can also just use init instead as a shortcut. ENVIRONMENT
Init sets the following environment variables for all its children: PATH /bin:/usr/bin:/sbin:/usr/sbin INIT_VERSION As the name says. Useful to determine if a script runs directly from init. RUNLEVEL The current system runlevel. PREVLEVEL The previous runlevel (useful after a runlevel switch). CONSOLE The system console. This is really inherited from the kernel; however if it is not set init will set it to /dev/console by default. BOOTFLAGS
It is possible to pass a number of flags to init from the boot monitor (eg. LILO). Init accepts the following flags: -s, S, single Single user mode boot. In this mode /etc/inittab is examined and the bootup rc scripts are usually run before the single user mode shell is started. 1-5 Runlevel to boot into. -b, emergency Boot directly into a single user shell without running any other startup scripts. -a, auto The LILO boot loader adds the word "auto" to the command line if it booted the kernel with the default command line (without user intervention). If this is found init sets the "AUTOBOOT" environment variable to "yes". Note that you cannot use this for any secu- rity measures - of course the user could specify "auto" or -a on the command line manually. -z xxx The argument to -z is ignored. You can use this to expand the command line a bit, so that it takes some more space on the stack. Init can then manipulate the command line so that ps(1) shows the current runlevel. INTERFACE
Init listens on a fifo in /dev, /dev/initctl, for messages. Telinit uses this to communicate with init. The interface is not very well documented or finished. Those interested should study the initreq.h file in the src/ subdirectory of the init source code tar archive. SIGNALS
Init reacts to several signals: SIGHUP Has the same effect as telinit q. SIGUSR1 On receipt of this signals, init closes and re-opens its control fifo, /dev/initctl. Useful for bootscripts when /dev is remounted. SIGINT Normally the kernel sends this signal to init when CTRL-ALT-DEL is pressed. It activates the ctrlaltdel action. SIGWINCH The kernel sends this signal when the KeyboardSignal key is hit. It activates the kbrequest action. CONFORMING TO
Init is compatible with the System V init. It works closely together with the scripts in the directories /etc/init.d and /etc/init.d/rc{runlevel}.d. If your system uses this convention, there should be a README file in the directory /etc/init.d explaining how these scripts work. FILES
/etc/inittab /etc/initscript /dev/console /var/run/utmp /var/log/wtmp /dev/initctl WARNINGS
Init assumes that processes and descendants of processes remain in the same process group which was originally created for them. If the processes change their group, init can't kill them and you may end up with two processes reading from one terminal line. DIAGNOSTICS
If init finds that it is continuously respawning an entry more than 10 times in 2 minutes, it will assume that there is an error in the command string, generate an error message on the system console, and refuse to respawn this entry until either 5 minutes has elapsed or it receives a signal. This prevents it from eating up system resources when someone makes a typographical error in the /etc/inittab file or the program for the entry is removed. AUTHOR
Miquel van Smoorenburg (miquels@cistron.nl), initial manual page by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de). SEE ALSO
init.d(7), getty(1), login(1), sh(1), runlevel(8), shutdown(8), kill(1), inittab(5), initscript(5), utmp(5) 29 Jul 2004 INIT(8)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy