systemd concept and operation mechanism

systemd concept

The core concept: unit

Dependencies

systemd Affairs

Start and run the target level

 

unit

Early versions of CentOS service management services but the script is replaced in the source file CentOS7. Background services need to start system initialization, the work required to complete a series configuration (e.g., mount the file system), or wherein each step of each task is systemd be abstracted as a unit, and the identification unit is configured by the corresponding configuration file, a unit cell corresponding to a file requires

Dependencies

Although systemd to maximize concurrent execution depend a lot about work, but some tasks have dependencies exist, and can not be executed in parallel. To solve this problem dependent. You can define dependencies between each other the systemd unit. Unit may be

Files using keywords to describe the dependency between the units. A unit as dependent cell B, in the definition of A may be the require cell B is represented by, so to ensure that it will start systemd A restart B.

systemd Affairs

systemd capable of completing the transaction, the transaction is different in the database, is intended to ensure that no cyclic references between the plurality of dependent cells. For example between cells A, B, C dependence, systemd will not start any service, systemd will rely for this purpose between the units are divided into two types: i.e., weak and strong dependency dependency. systemd can automatically fix configuration errors, greatly reducing the burden on the administrator troubleshooting.

Start and run the target level

systemd can create different packing, loading provides a flexible mechanism to set the boot configuration items. These states but by a plurality of source files, systemd these states is called the boot target.

The current level is the operating system running in the long run level of functionality. The standard Linux run level 0-6. Centos7 instead of using systemd init program to start the system initialization process, using the concept to replace the run to start the target level.

Run level is between mutually exclusive, can not be started simultaneously at multiple levels, multiple targets can be started at the same time start to start the goal of providing maximum flexibility, you can inherit an existing target, and add other services to create your own The goal

systemd large number of elements need to start at system startup. Each time you start all refer to this start which cells need. When you start a target, systemd will start where all units. From this perspective, the goal of this concept is similar to starting a state to start a target like to start some sort of state

CentOS number of predefined start the target, different from the previous version, for backward compatibility, systemd also let some startup target map to SysV run levels

systemd unit files

 

Guess you like

Origin www.cnblogs.com/linerbaby/p/11917022.html