Linux operating system boot process, that is, starting from the BIOS, then enter the boot Loader, then load the system kernel, and then initialize the kernel, and finally start the initialization process. Initialization process as the first process of Linux system, it needs to complete the relevant initialization work in Linux system, and provide the user with the appropriate working environment. The Red Hat Rhel 7 system has replaced the familiar initialization process service System V INIT, formally using the new SYSTEMD initialization process service. If you have previously studied Rhel 5 or Rhel 6 systems, you may not be used to it. The SYSTEMD initialization Process service adopts the concurrent startup mechanism, and the boot speed is improved. Although the SYSTEMD initialization process service has many new features and benefits, there are currently 4 slot points below.
Slot 1:SYSTEMD Initialization Process Service developer Lennart Poettering, who works for Red Hat, makes fans of other systems uncomfortable.
Slot 2:SYSTEMD Initialization Process service can only run on Linux systems and "discards" Unix system users.
Slot 3:SYSTEMD takes over the work of services such as SYSLOGD, Udev, Cgroup, and is no longer willing to do only initialization process services.
Slot 4: After using SYSTEMD to initialize the process service, the RHEL 7 system changes too much, and the relevant reference documents are not many, which makes users really embarrassed.
In any case, the RHEL 7 system chooses SYSTEMD initialization process service is already a established fact, so there is no "runlevel" concept, Linux system at startup to do a lot of initialization work, such as Mount file system and swap partition, start various process services, etc. These can be thought of as a single unit, and the SYSTEMD uses the target to replace the concept of runlevel in System V init, as shown in table 1-3.
Table 1-3 difference between systemd and system V init and its role
System V init Run level |
SYSTEMD Target Name |
Role |
0 |
Runlevel0.target, Poweroff.target |
Shutdown |
1 |
Runlevel1.target, Rescue.target |
Single-User mode |
2 |
Runlevel2.target, Multi-user.target |
Equivalent to Level 3 |
3 |
Runlevel3.target, Multi-user.target |
Multi-User Text interface |
4 |
Runlevel4.target, Multi-user.target |
Equivalent to Level 3 |
5 |
Runlevel5.target, Graphical.target |
Multi-User graphical interface |
6 |
Runlevel6.target, Reboot.target |
Restart |
Emergency |
Emergency.target |
Emergency shell |
If you want to modify the system's default run target to "multi-user, no graphics" mode, you can directly connect the multi-user mode target file to the/etc/systemd/system/directory using the LN command:
[root@linuxprobe ~]# ln-sf/lib/systemd/system/multi-user.target/etc/systemd/system/ Default.target
If a reader has previously learned the Rhel 6 system, or has been accustomed to using service, chkconfig and other commands to manage system services, it is now more depressing because the SYSTEMCTL command is used to manage the service in the Rhel 7 system. Table 1-4 and Table 1-5 shows the comparison of the system V init command with the SYSTEMCTL command in the Rhel 7 system in Rhel 6 systems.
Table 1-4 Common commands for SYSTEMCTL management services such as start, restart, stop, reload, view status, etc.
System V init command (RHEL 6 systems) |
Systemctl Command (RHEL 7 system) |
Role |
Service Foo Start |
Systemctl Start Foo.service |
Start the service |
Service Foo Restart |
Systemctl Restart Foo.service |
Restart Service |
Service Foo Stop |
Systemctl Stop Foo.service |
Stop Service |
Service Foo Reload |
Systemctl Reload Foo.service |
Reload configuration file (does not terminate service) |
Service Foo Status |
Systemctl Status Foo.service |
View service Status |
Table 1-5 Systemctl set up the service boot, do not start, see the level of service startup status, and other common commands
System V init command (RHEL 6 systems) |
Systemctl Command (RHEL 7 system) |
Role |
Chkconfig foo on |
Systemctl Enable Foo.service |
Boot auto Start |
Chkconfig foo off |
Systemctl Disable Foo.service |
Boot does not start automatically |
Chkconfig Foo |
Systemctl is-enabled Foo.service |
To see if a particular service is powered-up |
Chkconfig--list |
Systemctl List-unit-files--type=service |
viewing startup and disabling of services under various levels |
SYSTEMD initialization process Comparison of system V init commands and Systemctl commands in RHEL 7 systems in/rhel 6 systems