|Home||Switchboard||Unix Administration||Red Hat||TCP/IP Networks||Neoliberalism||Toxic Managers|
May the source be with you, but remember the KISS principle ;-)
Skepticism and critical thinking is not panacea, but can help to understand the world better
|Recommended Links||Grub||Boot Directly into a Shell||Runlevels||mount command||Serial console|
|Troubleshooting Errors in /etc/fstab||Mounting partitions with chroot||Linux root password recovery||/etc/inittab||/etc/fstab/||Filesystem mount options||Reverting permissions in etc to redhat defaults||Mounting Linux filesystems|
|Resetting root password on MySQL||Minimalistic and Rescue Linux Distributions||Humor||Etc|
After the kernel starts a program called init, the init process reads the file "/etc/inittab" and uses this file to determine how to create processes. It can boot OS to a certain state characterized by unique set of daemons, called runlevel.
The administrator can also dynamically change the current runlevel by using the init program.
The default runlevel into which the system is booted can be changed by editing the "/etc/inittab" file.
Which services are started in which runlevels can be managed with the chkconfig tool, which keeps its configuration settings in a set of link to scripts contained in /etc/rc.d/.
/sbin/chkconfig --list lists all the services controlled by chkconfig and whether they are on/off for each runlevel. Setting a service A controlled by chkconfig, for levels X, Y and Z is achieved using /etc/chkconfig --level XYZ A
See Runlevel - Wikipedia, the free encyclopedia
|Default level is defined in /etc/inittab, for example id:5:initdefault|
The "/etc/inittab" file tells init which runlevel to start the system at and describes the processes to be run at each runlevel. An entry in the inittab file has the following format:
# inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, <firstname.lastname@example.org> # Modified for RHS Linux by Marc Ewing and Donnie Barnes # # Default runlevel. The runlevels used by RHS 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) # 1) id:3:initdefault: # System initialization. 2) si::sysinit:/etc/rc.d/rc.sysinit 3) l0:0:wait:/etc/rc.d/rc 0 4) l1:1:wait:/etc/rc.d/rc 1 5) l2:2:wait:/etc/rc.d/rc 2 6) l3:3:wait:/etc/rc.d/rc 3 7) l4:4:wait:/etc/rc.d/rc 4 8) l5:5:wait:/etc/rc.d/rc 5 9) l6:6:wait:/etc/rc.d/rc 6 # Things to run in every runlevel. 10) ud::once:/sbin/update # Trap CTRL-ALT-DELETE 11) ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, assume we have a few minutes # of power left. Schedule a shutdown for 2 minutes from now. # This does, of course, assume you have powerd installed and your # UPS connected and working correctly. 12) pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" # If power was restored before the shutdown kicked in, cancel it. 13) pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" # Run gettys in standard runlevels 14) 1:2345:respawn:/sbin/mingetty tty1 15) 2:2345:respawn:/sbin/mingetty tty2 16) 3:2345:respawn:/sbin/mingetty tty3 17) 4:2345:respawn:/sbin/mingetty tty4 18) 5:2345:respawn:/sbin/mingetty tty5 19) 6:2345:respawn:/sbin/mingetty tty6 # Run xdm in runlevel 5 # xdm is now a separate service 20) x:5:respawn:/etc/X11/prefdm -nodaemonOn the left side of the file listing, above, are added numbers to help describe lines. Those lines without line numbers are either blank or begin with a "#" which means the line is a comment. Those line numbers are not part of the original file and are added here for reference purposes.
Note the order of programs to run as specified above are:
Therefore, the next thing that the system does is to run the rc.sysinit file, save buffers to the hard drive, then run system script files for the requested runlevel which will start up many system and network services as explained in the next section.
The default boot runlevel is set in the file /etc/inittab with the initdefault variable. When set to 3, the system boots up with the text interface on the VGA console; when set to 5, you get the GUI. Here is a snippet of the file (delete the initdefault line you don't need):
# Default runlevel. The runlevels used by RHS 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: # Console Text Mode id:5:initdefault: # Console GUI Mode
Note the following:
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info|
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: March, 12, 2019