Linux Basics: 4, Linux runlevel, single-user mode, rescue mode

Source: Internet
Author: User

Linux Run Level

Meaning: refers to different operating modes under UNIX or Linux Unix-like operating systems. The runlevel is usually divided into 7, from 0 to 6, respectively.

==================================================================================[[email protected]  ~]# tail /etc/inittab# default runlevel. the runlevels used 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)                                                        #多用户模式, less than 3 levels of network connectivity #   3 - full multiuser  mode                         #多用户模式 #   4 - unused                                       #保留级别 #    5 - X11                                          #图形模式 #   6 - reboot  (do not  Set initdefault to this)     #重启 #id:3:initdefault:                                    #意思是把3级别设置为默认级别 ======================================================================= ===========

Script directory for each runlevel

================================================================================== #Centos的0-6 run-level directory [email  protected]an01 ~]# ls -ld /etc/rc*.dlrwxrwxrwx.  1 root root    10 Feb 13 05:14 /etc/rc0.d -> rc.d/rc0.dlrwxrwxrwx.   1 root root   10 Feb 13 05:14 /etc/rc1.d ->  rc.d/rc1.dlrwxrwxrwx.  1 root root   10 feb 13 05:14 / Etc/rc2.d -> rc.d/rc2.dlrwxrwxrwx.  1 root root   10 feb  13 05:14 /etc/rc3.d -> rc.d/rc3.dlrwxrwxrwx.  1 root root    10 Feb 13 05:14 /etc/rc4.d -> rc.d/rc4.dlrwxrwxrwx.   1 root root   10 Feb 13 05:14 /etc/rc5.d ->  Rc.d/rc5.dlrwxrwxrwx.  1 root root   10 feb 13 05:14 /etc/rc6.d -> rc.d/ rc6.ddrwxr-xr-x. 10 root root 4096 feb 13 05:14 /etc/rc.d# Kill priority and start priority in the RUNLEVEL3 directory, the higher the number the lower the priority [[EMAIL PROTECTED] ~]# LS /ETC/RC3.DK10SASLAUTHD     K89rdisc      S10network  S25netfs       S80postfixK50netconsole   S08ip6tables  S11auditd    S26udev-post  S90crondK87restorecond  S08iptables   S12rsyslog   s55sshd       s99local=============================================== ===================================

extension, CENTOS7 has replaced the default targets settings in Inintab files with RunLevel

==================================================================================[[email protected]  ~]# cat /etc/inittab# inittab is no longer used when using  systemd.## adding configuration here will have no effect on  your system.## ctrl-alt-delete is handled by /etc/systemd/system/ ctrl-alt-del.target## systemd uses  ' Targets '  instead of runlevels. By  Default, there are two main targets:## multi-user.target: analogous to  runlevel 3# graphical.target: analogous to runlevel 5## to set  a default target, run:## ln -sf /lib/systemd/system/<target name >.target /etc/systemd/system/default.target#** to set the default soft connection using the Default.target soft connection **[[email protected]  ~]# ll /lib/systemd/system/default.targetlrwxrwxrwx. 1 root root 16 sep 13 07:19 /lib/ systemd/system/default.target -> graphical.target================================================ ===================================


Single-User mode

Meaning: RunLevel 1, used to maintain the operating level of the system.

Role:

Change the root account password

Backup system, Recovery system

Maintain system partitions, file systems, etc.

Entry method:

In the Grub interface, press either a (modify boot parameter) or e (edit edit mode), and then enter "single" After the last empty space in the kernel line, to tell the bootloader to enter Linux in one-user mode;


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/C7/wKioL1Th-Z2xbF01AAGBOR-aSOY147.jpg "style=" float: none; "title=" Qq20150216215728.png "alt=" Wkiol1th-z2xbf01aagbor-asoy147.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/CA/wKiom1Th-KLQ5VdzAAHrySwJgsI145.jpg "style=" float: none; "title=" Qq20150216215825.png "alt=" Wkiom1th-klq5vdzaahryswjgsi145.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/59/C7/wKioL1Th-aGCqNHGAAEDCL6qslo226.jpg "style=" float: none; "title=" Qq20150216215850.png "alt=" Wkiol1th-agcqnhgaaedcl6qslo226.jpg "/>

#centos6.5 You need to press ESC at startup to stay in the grub interface.

#grub界面也可以按下c来进入command模式, not recommended, too many things to enter too hard to remember


Rescue mode

Single-player mode can do a lot of maintenance action, but if you encounter system crashes, grub and other system-level errors we should respond to, the answer is to insert the system CD into the rescue mode.

Personal Understanding: The CD-ROM provides a shell environment to load the original system environment via mount and chroot to repair the system.

Enter the method: Insert the disc, install the System interface press the TAB key, and then enter "Linux Rescue" to enter;

#暂时无太大研究, just a simple understanding, keep your attention down and move on


This article is from the "30 Demon People" blog, please make sure to keep this source http://301ren.blog.51cto.com/8887653/1614707

Linux Basics: 4, Linux runlevel, single-user mode, rescue mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.