The concept of the unit of Linux service management

Source: Internet
Author: User

1. Type

SYSTEMD opening and overseeing the entire system is based on the concept of unit. The unit is made up of a name and type with the same name as the configuration file name (for example: Avahi.service unit has a configuration file with the same moniker, which is a package unit of the daemon Avahi). The unit has several types:

  • Service: Represents a background services process, such as mysqld. This is the most commonly used category.

  • Sockets: This class of Hive encapsulates the system and a socket in the Internet. Now, SYSTEMD supports streaming, datagram and Af_inet,af_inet6,af_unix sockets for sequential packets. Each socket hive has a corresponding service hive, and the corresponding service starts when the first connection enters the socket (for example: Nscd.socket starts nscd.service after a new connection).

  • Device: This class of hives encapsulates a device that exists in the Linux device tree. Each device marked with Udev rules will appear as a device hive in Systemd.

  • Mount: This class of hives encapsulates a mount point in the file system hierarchy. SYSTEMD will monitor and manage this mount point. For example, it can be mounted automatically at startup, and can be uninstalled automatically under certain conditions. SYSTEMD will convert the entries in the/etc/fstab to mount points and process them at boot time.

  • AutoMount: This class of Hive encapsulates a self-mounting point in the system hierarchy. Each self-mounted hive corresponds to a Mount hive, and when the automatic mount point is accessed, SYSTEMD performs the mount behavior defined in the mount point.

  • Swap: Similar to mount Hive, the Swap hive is used to manage the swap partition. Users can use swap hives to define swap partitions in the system so that these swap partitions are activated at startup.

  • Target: This type of hive logically groups other hive units. They do not actually do anything, they simply refer to other hive, so that a unified control of the hive can be implemented to achieve the concept of runlevel that everyone is very familiar with. For example, to get the system into graphical mode, you need to run a number of services and configuration commands, all of which are represented by a single hive that combines all of these hives into one target, which means that they need to be executed all over again. In order to enter the system running state that the target represents (for example: Multi-user.target is equivalent to running level 5 in a system that traditionally uses sysv).
  • Timer: The timer hive is used to trigger user-defined actions on a timed basis. This type of configuration unit replaces traditional timing services such as Atd,crond.


The concept of the unit of Linux service management

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.