Start Process
==========
To start a Linux system, follow these steps:
1. Read the MBR information and start the Boot Manager.
In Windows, NTLDR is used as the Boot Manager. If multiple versions of Windows are installed in your system, you need to select the system to enter from NTLDR.
Linux usually uses the powerful and flexible GRUB configuration as the Boot Manager. We will introduce how to use it in the startup management chapter.
2. 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.
3. The init process reads the information in the "/etc/inittab" file, enters the preset running level, and runs the scripts in the corresponding folder of the running level in sequence. The script is usually started with the "start" parameter and points to a program in the system.
Generally, the startup script under the "/etc/rcS. d/" directory is first executed, and then the "/etc/rcN. d/" directory. For example, if you set the running level to 3, the corresponding startup directory is "/etc/rc3.d /".
4. Start the Xwindow server "xorg" according to the script in the "/etc/rcS. d/" folder"
Xwindow is a graphical user interface system in Linux.
5. Start the logon manager and wait for the user to log on.
By default, you can log on to the system using the Windows agent system as the logon manager. You can log on to the system by entering the user name and password on the logon Manager page. (You can find a link named "s13tpd" in the "/etc/rc3.d/" folder)
Change running level
----
Find the following content in the "/etc/inittab" file:
# The default runlevel.
Id: 2: initdefault:
The number 2 in this row indicates the system running level. The default running level is as follows:
0 Shutdown
1. single-user maintenance mode
2 ~ 5-User Mode
6. Restart
Service Management
==========
Change startup Service
----
In the folder corresponding to the running level, you can see many startup script links starting with "S #" and "K #" in the file names.
For example:
Mount the file system to/etc/rcS. d/S35mountall. sh.
/Etc/rcS. d/S40networking enable Network Support
/Etc/rc2.d/s13tpd start the logon Manager
/Etc/rc2.d/S20makedev
/Etc/rc2.d/S23xinetd start the super Process
The init process uses "start" as the parameter and executes all scripts starting with "S #" in the order of file names. The smaller the number in the script name, the earlier it will be executed. For example, if the number in the "/etc/rc2.d/" folder is smaller than "S23xinetd", "s13tpd" is executed before "S23xinetd.
If a script link starts with "K #", it will be executed with the "stop" parameter. If the service is not started, the script is not executed.
For example:
/Etc/rc2.d/K20powernowd power management support for certain hardware
If you want to disable automatic running of a service at startup, You can rename the script in the corresponding running level from "S # xxx" to "K # xxx ".
Manual control service
----
You can also manually run the startup script with the following parameters to control system services.
Start
Stop
Restart
For example:
/Etc/rc2.d/K20powernowd start
If yes, you do not know the current running level. The corresponding script may not exist under this level. The first three characters of such scripts are not fixed and are hard to remember. In this case, you can directly use "/etc/init. d/"folder STARTUP script ("/etc/rcX. link the startup script in d/to/etc/init. d/"folder), which is the recommended method.
For example:
/Etc/init. d/powernowd start
Tips: The above command is not included in the search path of the environment variable, So enter the complete path.
Common system services
================
Acpi-support advanced power management support
Acpid acpi daemon. These two are very important for power management.
Alsa sound Subsystem
Alsa-utils
Anacron cron sub-system, scheduled tasks during system shutdown are executed the next time the system is running.
Apmd acpi Extension
Atd is similar to the cron task scheduling system. Disable
Binfmt-support core supports other binary file formats. Enable
Bluez-utiles bluetooth device support
Bootlogd startup log. Enable it
Cron task scheduling system. We recommend that you enable
Cupsys printer subsystem.
Refers to the Message bus system ). Very important
DNS-clean clears DNS information when using a dial-up connection.
Evms Enterprise Volume Management System)
Fetchmail user proxy for receiving emails
You can log on to and use the table manager.
Gdomap
The mouse in the GPM terminal is supported.
Halt.
Hdparm adjusts the hard disk script. The configuration file is "/etc/hdparm. conf ".
Hibernate System sleep
Hotkey-setup Notebook function key support. Supported types include HP, Acer, Asus, Sony, Dell, and IBM.
Hotplug and hotplug-net plug-and-play support is complicated. We recommend that you do not change it.
Hpc ip hp printer and graphics Subsystem
Ifrename Network Interface rename script. If you have ten NICs, you should enable it
Inetd in the file "/etc/inetd. conf", comment out all services you do not need. If the file does not contain any services, it is safe to disable it.
Klogd is important.
Supported by Linux-restricted-modules-common restricted modules. The modules in the "/lib/Linux-restricted-modules/" folder are restricted modules. For example, some drivers do not need to be enabled if you do not use restricted modules.
Supports the LVM logical volume management system.
Makedev is very important to create a device file.
Mdamd disk array
Module-init-tools: load the extension module from/etc/modules. We recommend that you enable this function.
Networking network support. It is very important to activate the network by pressing the/etc/network/interfaces file.
We recommend that you disable the ntpdate time synchronization service.
Pcmcia device support.
Powernowd mobile CPU energy-saving support
Ppp and ppp-dns dial-up connection
Readahead: pre-load the library file.
Reboot.
Resolvconf automatically configures DNS
Rmnologin clear nologin
Rsync daemon
Sendsigs sends signals during restart and Shutdown
Single activation single User Mode
Ssh daemon. Enable
Stop-bootlogd stops the bootlogd service at the, running level
Sudo checks the sudo status. Important
Sysklogd System Log
Udev & udev-monoclonal user space dev File System (userspace dev filesystem ). Important
Umountfs detach a File System
Urandom random number generator
Usplash boot screen support
Vbesave video card BIOS Configuration tool. Save the status of the video card
Xorg-common sets X service ICE socket.
Adjtimex tool for adjusting core clock
Dirmngr certificate list management tool, working with gnupg.
Hwtools irqs optimization tool
After the libpam-devperm system crashes, it is used to repair the daemon for the device file license.
Lm-sensors onboard sensor support
Mdadm-raid disk Display Manager
Screen-cleanup script for clearing the boot screen
An inetd super daemon that manages other daemon.
Important configuration files
================
! In any case, back up the configuration file before modifying it!
We recommend that you use this command: "sudo cp xxx _ 'date + % y % m % d _ % H: % m '".
Of course, this is very troublesome. You can create a file named "bak" with the following content:
#! /Bin/bash
Sudo cp $1 $1 _ 'date + % y % m % d _ % H: % m'
Put it in a directory that you can remember, such as "/home", execute the command "sh/home/bak xxx ", you can save the file "xxx" in the current folder as "xxx_yymmdd_HH: MM ".
Global configuration file
----
System initialization
/Etc/inittab running level, number of consoles
/Etc/timezone Time Zone
/Etc/inetd. conf super Process
File System
/Etc/fstab file system mounted at startup
/Etc/mtab file system currently mounted
User System
/Etc/passwd user information
/Etc/shadow User Password
/Etc/group information
/Etc/gshadow group password
/Etc/sudoers sudoer list (use the "Modify do" command to modify this file instead of editing it directly)
Shell
/Etc/Shell available shell list
/Etc/inputrc Readline control settings
/Etc/profile user preferences
/Etc/bash. bashrc bash configuration file
System Environment
/Etc/environment variable
/Etc/updatedb. conf file to retrieve database configuration information
/Etc/issue release information
/Etc/issue.net
/Etc/screenrc Screen Settings
Network
/Etc/iftab Nic MAC Address binding
/Etc/hosts host list
/Etc/hostname Host Name
/Etc/resolv. conf domain name resolution server address
/Etc/Network/interfaces Nic configuration file
User Configuration File
----
Only the root user can modify all files in the "/etc/" directory. The global configuration file of the application cannot be modified by common users. If you want to configure the software to meet your needs, you can modify its user configuration file.
The user configuration file is usually a hidden file with the same name as the global configuration file, which is stored in your $ HOME directory. For example:
/Etc/inputrc/home/user/. inputrc
/Etc/vim/vimrc/home/user/. vim/vimrc
There are also a few exceptions, usually system programs
/Etc/bash. bashrc/home/user/. bashrc