Update-rc.d commands in Ubuntu or Debian systems are scripts used to update system startup items. The links of these scripts are located in the/etc/rcN. d/directory, and the corresponding scripts are located in the/etc/init. d/directory. Before learning about update-rc.d commands, you need to know the main startup steps for Linux and the running level in Ubuntu. 1. in Linux, read the MBR information and start BootManager. Loading System
Update-rc.d commands in Ubuntu or Debian systems are scripts used to update system startup items. The links of these scripts are located in the/etc/rcN. d/directory, and the corresponding scripts are located in the/etc/init. d/directory. Before learning about update-rc.d commands, you need to know the main startup steps for Linux and the running level in Ubuntu.
1. Main Linux Startup steps
Read the MBR information and start the Boot Manager.
Load the system kernel and start the init process. The init process is the root process of Linux, and all system processes are its sub-processes.
The init process reads information from the/etc/inittab file and enters the preset running level. Generally, the startup script in the/etc/rcS. d/directory is executed first, and then the/etc/rcN. d/directory.
Start Xwindow server xorg Based on the script in the/etc/rcS. d/folder. Xwindow is the graphic user interface system in Linux.
Start the logon manager and wait for the user to log on.
Ii. Operation Level
Running level in Ubuntu
0 (shut down the system)
1 (in single-user mode, only root users are allowed to maintain the system .)
2 to 5 (multi-user mode, where 3 is the character interface, and 5 is the graphical interface .)
6 (restart the system)
Switch operation level
Init [0123456Ss]
For example, the init 0 command is shut down, and the init 6 command is restarted.
Startup item management tool
Sudo install sysv-rc-conf // or use the tool bum with gui
Sudo sysv-rc-conf
3. Detailed explanation of update-rc.d commands
Deletes a specified startup Item from all running levels.
Update-rc.d-f <basename> remove
Start or close in the specified order at the specified running level
Update-rc.d <basename> start | stop <order> <runlevels>
Instance: update-rc.d apachectl start 20 2 3 4 5. stop 20 0 1 6.
Resolution: indicates that apachectl starts to run in the 5 running levels of 2, 3, 4, and 5, from small to large. In the 3 running levels of 0 1 6, 20th disable apachectl. This is the combination method. Note that it has two dots, and the effect is equal to the following method:
Update-rc.d apachectl defaults
A can be started only after it is started. B can be closed only after it is started.
Update-rc.d A defaults 80 20
Update-rc.d B defaults 90 10
The order of startup and shutdown is 90, And the level is default.
Update-rc.d <basename> defaults 90