Ubuntu Run level
The Linux system runs at a specified run level at any time, and the different run level programs and services are different, the work to be done and the purpose to achieve is different, the system can switch between these operational levels to accomplish different tasks.
RunLevel (Runlevel) refers to different operating modes under UNIX or UNIX-like Linux operating systems.
The runlevel is usually divided into 7, ranging from 0 to 6, but can be more if necessary.
For example, under most Linux operating systems, there are 6 typical operating levels:
0 shutdown notstart daemons, or allow non-root loginsnotstart Daemons3 Users, start network connection starts the system normally.4 user-defined 5 Multi-user with graphical interface 6 restart
To view the current operating level of the system, you can use the command runlevel
RunLevel
To switch the run level, execute the command:
init [0123456Ss]
(That is, after the init command followed by a parameter, this parameter is the run level code to switch to the run level, such as: Shutdown with the init 0 command; Restart with the Init 6 command.) )
Linux System main boot steps
1. Read the information from the MBR, startBootManager,windows uses NTLDR asBootManager,If you have multiple versions of Windows installed on your system,you will need to select the system you want to enter in the NTLDR. Linux is often used in powerful, configure the flexible grub asBootManager. 2. Load the system kernel,starting the Init process, the init process is the root process of Linux,all of the system processes are its child processes. 3. The init process reads the information from the/etc/inittab file and enters the preset runlevel,run the script under the corresponding folder for that run level in order. Scripts typically use theStartparameter Start,and point to a program in a system. Usually, the startup script under the/etc/rcs.d/directory is executed first,then the/etc/rcn.d/directory. For example, you set the run level to 3,then it corresponds to the startup directory for/etc/rc3.d/. 4. According to/etc/rcs.d/the corresponding script in the folder launches the X Window Server Xorg,x window as a graphical user interface system under Linux. 5. Start the login manager,Wait for user login, Ubuntu system by default using GDM as login manager,After you enter your user name and password in the Login Manager interface, you can log in to the system. (You can/etc/rc3.d/thefolder to find a link named S13GDM)
Run level in Ubunto
In Debian Linux 2-5 of these four runlevel are concentrated on level 2. This level is also the normal operating level of the system preset. (Note: For these runlevel we don't have to be too tangled with what that means, just know that in Debian/ubuntu (Ubuntu is the branch of Debian) Linux is enabled by default at level (Runlevel) 2)
In Debian Linux, the following paths correspond to different runlevel. When the system starts, the corresponding service is started through the script file.
Run Run Run Run Run Run Run
Below we go to the/etc/directory to find these directories, enter in the terminal
Note: For files beginning with K, the system will terminate the corresponding service; For files beginning with S, the system will start the corresponding service;
Now for the Debian/ubuntu Linux boot process you should have some understanding, summed up the following:
The files that are stored in the/ETC/RC0.D~RC6.D directory are the services to be started when running at 0~6 run level, because Ubuntu is enabled by default in RunLevel 2, Then we need to modify the files in the rc2.d, which prevents some services from starting, such as apache2.
Review the files in the/ETC/RC2.D directory just now to find apache2 related files are s91apache2.
We look at the following Apache file attributes:
The system will start the corresponding service by simply introducing a file that begins with S.
Look for the following Apache status under other run levels:
We will find that Apache is booting up at run Level 2, 3, and 4.
So what we're going to do is change the s91apache2 to k******, but we don't know how much to change, here we need to manage with a management tool, namely sysv-rc-conf.
Sysv-rc-conf is a service management program, other similar software has chkconfig, rcconf and so on.
Installing sysv-rc-conf
Install with Apt-get under Ubuntu:
sudo apt-get install sysv-rc-conf
Run
sudo sysv-rc-conf
The first line of service is followed by the RunLevel, with 1,2,3,4,5,0,6,s, which basically conforms to the RunLevel described earlier, and the last item S is all.
The figure of the X is to run in the corresponding runlevel when the start-up service, here we can see apache2 in runlevel2,3,4, are boot-start.
Corresponding to the previous/ETC/RC2.D~/ETC/RC5.D directory is the S91apache2 file, again verify the previous content.
Move the cursor to the 2nd column of the Apache2 row, press the space to reverse the startup item, and press Q to exit after the configuration is complete.
Now let's take a look at the contents of the/etc/rc2.d/directory:
Ls/etc/rc2.d
Now that the K09apache2 file has appeared, and the previous s91apache2 file is not there, the configuration succeeds here.
Check Apache service run status after reboot
Common system Service Information
1 Acpi-support Advanced Power Management support2Acpid ACPI Daemon. These two are used for power management,very Important3 ALSA Sound Subsystem4 alsa-utils5Anacron Cron subsystem that will shut down the system during scheduled tasks,executes the next time the system is run. 6 APMD ACPI Extensions7 ATD is similar to Cron's task scheduling system. Recommended Close8 the Binfmt-support core supports additional binary file formats. Recommended to open9 bluez-utiles Bluetooth Device supportTen bootlogd start the log. Turn it on. OneCron Task scheduling system,recommended to open A Cupsys the printer subsystem. -Dbus Message bus System. Very important -Dns-clean when using a dial-up connection,clears the DNS information. theEVMS Enterprise Volume Management Systems (Volumn Management System) -Fetchmail Mail User Agent daemon,for receiving mail - GDM Gnome Login and desktop manager. - Gdomap + mouse support in the GPM terminal. - halt don't touch it. +Hdparm adjust the script of the hard disk, the configuration file is/etc/hdparm.Conf. A Hibernate System Hibernation atHotkey-setup notebook function key support. Support types include: HP, Acer, ASUS, Sony,dell,and IBM. -HotPlug and hotplug-NetPlug and Play support, more complex,it is advisable not to move it. - hplip HP Printer and graphics subsystem -Ifrename the network interface to rename the script. If you have 10 NICs,you should turn it on -inetd in the file/etc/inetd.conf, comment out all the services you don't need. If the file does not contain any services,It's safe to shut it down. - klogd Important. in Linux-restricted-modules-common Limited module support. -The module in the/lib/linux-restricted-modules/folder is a restricted module. For example, some drivers, if you are not using restricted modules,There is no need to open it. to LVM Logical Volume management system support. +Makedev Create a device file,very important. - MDAMD disk array theModule-init-tools load the expansion module from/etc/modules,recommended to open. *Networking network support. Activate the network by pressing the/etc/network/interfaces file preset.very important. $Ntpdate Time Synchronization Service,recommended to close. Panax Notoginseng PCMCIA PCMCIA Device Support. - powernowd Mobile CPU Energy Saving support the PPP and Ppp-dns dial-up Connections + readahead pre-load library files. A reboot don't touch it. the resolvconf Configuring DNS automatically + Rmnologin Clear Nologin - rsync rsync Daemon $ Sendsigs sending signals during reboot and shutdown $ single activates one-user mode - ssh ssh daemon. Recommended to open -Stop-bootlogd in 2,3,4,5Stop BOOTLOGD service in run level the sudo check sudo status. Important - SYSKLOGD System LogWuyiUdev & udev-mab User space dev file system (Userspace dev FileSystem). Important the Umountfs Uninstalling the file system - urandom random number generator Wu USplash boot screen support - Vbesave Graphics card BIOS Configuration tool. Save the status of the video card About Xorg-common set X service ICE socket. $ Adjtimex Tools for adjusting the core clock -DIRMNGR Certificate list management tool,work with GnuPG. - hwtools IRQs Optimization tool -After the libpam-devperm system crashes,a daemon used to repair device file licenses. A Lm-sensors onboard sensor support + mdadm-raid disk display manager the screen-cleanup Clear the boot screen script -XINETD a inetd Super daemon that manages other daemons
Reference:
http://blog.csdn.net/gatieme/article/details/45251389 (the above content is transferred from this article)
Http://www.linuxidc.com/Linux/2012-10/73123p2.htm
Linux Service Management (Ubuntu Service Management tool sysv-rc-conf) (GO)