About Ubuntu Modifying the default run level

Source: Internet
Author: User

The first method: (Kernel level)  sudo vi/etc/default/grub modify grub_cmdline_linux_default= "Quiet Splash" as: grub_cmdline_linux_ default= "Text" and then run under sudo update-grub2.   The second method: (Based on the upstart "Orthodox" method)  ubuntu upstart system,/etc/ INIT.D inside is basically connected to the/lib/init/upstart-job soft connection, so, initscripts request all converted to upstart event, upstart system to start the project management all according to/etc/ Init inside the config file to start, can start LIGHTDM events let people raspberry   edit file/etc/init/lightdm.conf start on (Filesystemand started Dbusand ( graphics-device-added fb0 primary_device_for_display=1or drm-device-added card0 primary_device_for_display=1or Stopped Udevtrigger)) or RunLevel prevlevel=s) stop on RunLevel [016]  visible, once file system initialization occurs, Dbus bus start and occur graphics-device-added fb0 Primary_device_for_display=1 or drm-device-added card0 primary_device_for_ Display=1 or stopped Udevtrigger or runlevel prevlevel=s any of these events, GDM will be started, and GDM does not start until the RunLevel is 016. So, the event is also clear, to kill GDM at the upstart level, the above start-related events commented out, rewrite the next line   because Ubuntu default mode is 2, so: Start On (Filesystemand started Dbusand ( graphics-device-added fb0 Primary_device_for_display=1or drm-device-added card0 Primary_device_for_display=1or stopped Udevtrigger) and RunLevel [345]) stop on RunLevel [0126]& nbsp; restart.   Third method:  1, block default graphical desktop boot  ubuntu 12.04 The default opening opportunity to enter a graphical interface, he is implemented by the LIGHTDM process.   The first thing to do is to stop this LIGHTDM process from booting up. Procedure:  (1), view file/etc/init/rc-sysinit.conf, near line 14th: Confirm "env default_runlevel=2". 2 is the default for the newly installed system, ensuring that it is not modified.   (2), edit file/etc/init/lightdm.conf, near line 12th, the original sentence "and RunLevel [!06]" is changed to "and RunLevel [!026]".   Explanation: The Linux system has a running level (RunLevel) concept, different RunLevel configuration will lead to a large difference in the system startup process, such as when the configuration RunLevel is 1, is not into the graphical interface. During system startup there will be an INIT process to pull up many other processes (various system services, window interfaces). On Ubuntu (11.10,12.04 is so, other versions or other Linux distributions are not sure) Init executes scripts in two directories, one under/etc/init/and the other/etc/rc. D/, the question mark may be one of the numbers in 0~6, which represents the RunLevel. Next, explain the process to deepen your understanding.   on Ubuntu, the INIT process first executes the rc-sysinit.conf in the/etc/init/directory, which indicates the default run level for this startup. This is the meaning of the first step above: Make sure that the default runlevel is 2. Next, the execution of other scripts under directory/etc/init will take different actions depending on the runlevel, for example, LIGHTDM will determine if the runlevel is in 1,2,3,4,5, start LIGHTDM, or not start LIGHTDM. This is the meaning of the second step above, modify the lightdm.conf, add "2" to the judgment statement, so that LIGHTDM at run Level 2 do not start. With that in mind, you can be flexible, such as setting the default level to 3, and adding 3 to that judgment statement, orAchieves the effect of blocking LIGHTDM startup. The INIT process continues execution of the script under the/ETC/RC2.D directory, completing the startup action in the/etc/init/directory.  2, off Ubuntu loading screen  ubuntu start, there will be an Ubuntu word appears on the screen, text below the flashing dots, then press ESC to switch between the animation and the text interface. This step does not belong to the LIGHTDM, but a process called Plymouth is in effect. In fact, the meaning of Plymouth is to show an animation during the time it is powered on to the graphical desktop (LIGHTDM), thereby improving the user experience.   Shielding Method:  (1), edit/etc/default/grub file, near the original line 11:  grub_cmdline_linux_default= "Quiet Splash"    Remove "Splash", after change:  grub_cmdline_linux_default= "quiet"   (2), execute command:  sudu updat-grub  Restart, you can see, No more loading screen appears     reading below to better understand (extended reading):   linux  system main boot steps:  1. To read the information from the MBR, start boot manager  windows using NTLDR as the boot Manager, if you have multiple versions of Windows installed on your system, you will need to select the system you want to enter in NTLDR. linux  typically uses a powerful, flexible grub as the Boot Manager.   2. Load the system kernel, start the init process     init process is the root process of Linux, all system processes are its child processes.   3. The init process reads the information from the/etc/inittab file and goes to the preset run level,     runs the script under the corresponding folder for that run level in order. Scripts are typically started with the start parameter and point to a program in a system. Typically, the startup script under the/etc/rcs.d/directory is executed first, followed by the/etc/rcn.d/directory. For example, if you set a run level of 3, the corresponding startup directory is /etc/rc3.d/.  4. Start the Xwindow server xorg Xwindow as a graphical user interface system under Linux based on the corresponding script in the/etc/rcs.d/folder.  5. Start the login manager, wait for the user to log in    the Ubuntu system uses GDM as the login Manager by default, and after you enter the user name and password in the Login Manager interface, you can log in to the system. (You can find a link in the/etc/rc3.d/folder named S13GDM)    ubuntu init and system service Settings  init init is a program located in/sbin/init , it is a user-level program that is initiated by the kernel, and thus the INIT program completes the system startup process, after initializing all device drivers and data structures during the system startup process under Linux.    ubuntu is slightly different from traditional Linux and uses upstart to complete the boot of the system, but still maintains the form of the INIT program on the surface.   RunLevel   Linux has several different operational levels, including the following:    # 0-Stop  # 1-Single user mode  # 2-multiuser, no nfs # 3-full Multi-user mode (standard run level)  # 4– system reserved  # 5–x11 (x Window)  # 6-restart     at which level after system startup is read by Init/etc/ The lack of provincial-level settings in the Inittab file determines that half of the graphical interface's system is entered in levels 3.     but Ubuntu is not the same as traditional, the/etc/inittab file is not found by default, and there are different levels of runlevel, such as the following:    # 0– shutdown system  #-Single user mode  # 2~5– full multi-user mode  # 6– Restart   that is, by default, Levels 2, 3, 4, 5 are the same, and the default level setting for the system is not in the Inittab file, but in the/ The etc/init/rc-sysinit.conf file. Open this file, you can find the following sentence:  env Default_runlevel=2  This indicates that the system is currently entering level 2 by default.   Also, in this article, there is a code that starts with if [-r/etc/inittab], which preserves the ability to specify the default RunLevel of the system using Inittab, that is, if the user creates/etc/inittab manually, Init will use the/etc The default run level specified in/inittab for system startup. For example, if the user wants the system to run at level 3 as the default, simply add the following line to the Inittab file: id:3:initdefault:  the/etc/init/ After rc-sysinit.conf determines the RunLevel, Init will run the/ETC/INIT.D/RC further and then enter/etc/rc[according to the level. D start or close the appropriate service.   Service startup and shutdown script  ubuntu start and close the service script to store with/etc/rc[?]. The D directory. where [x] represents 0~6, corresponding to level 0~6, such as Rc0.d  rc1.d  rc2.d  rc3.d  rc4.d  rc5.d  rc6.d in/etc directory. Assuming that the default level specified in Rc-sysinit.conf or Inittab is 2, Init executes the script in the/ETC/RC2.D directory to start or close the service.     if Open/etc/rc[?]. D directory, you will find that the files in these directories are symbolic links that are shaped like snnxxxx or knnxxxx, and are all pointing to/ETC/INIT.D. That is to say, the startup or shutdown scripts for services under different operating levels are placed under/ETC/INIT.D, only in response to different levels of/etc/rc[. D directory A link, different levels will require different services, so different/etc/rc[?]. The link files under the D directory are also different.     the representation in the link file that starts with s in the call/etc/ INIT.D the script in the directory will be passed a start parameter, that is, to start the corresponding service, and the beginning of K is to pass a stop parameter, thus shutting down the service, where k means kill. The nn behind    s and K is a number that indicates the order in which this script is executed, the trumpet is in front of the Queen, so that there may be a succession of dependencies between different services. For example, the FTP service relies on the start of a network serviceSo the number of the FTP service is larger than the number of the network service, and starts after the network service starts.     the last xxxx is the name of the service.   Also, in addition to the/ETC/RC[0~6].D file, there is a/ETC/RCS.D directory with a service script similar to the/ETC/RC[0~6].D format and a link to the script in/etc/init.d, but in/ETC/RC [The script in 0~6].D is executed first before execution.]

About Ubuntu Modifying the default run level

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.