06.1 (Conspect) SystemdServices

Mounting file systems

Usually, the classic method of loading the operating system is designed in such a way that it can be easily used for the server.

However, modern computers are arranged in General not so (the network was the first to suffer from this, as the network is a dynamic thing). In the media section, we will create a disk and add a hard disk to the controller. And we will learn how to attach this disk to a file and mount it in the tree of our file systems. Init (the father of all processes). As we are engaged in system administration, so most of the work has to be performed by the superuser.

In the AltLinux community, the use of the sudo utility is not very common, because if you abuse it without much precise knowledge of how it works, you can build such holes in the system. So the suggestion is to use su. The key - is another feature of distributions of the AltLinux community, which consists in the fact that, according to the standard, the su utility gets the right of the desired user, but leaves the environment of the old user (the home directory, the path environment variable). We have attached another disk to our VM. The gparted command has a graphical interface (a lot of graphics that are good for those who understand what is going on, and bad in the sense that there is a lot of it for those who do not understand what is going on). We want to create an ext4 partition on this disk. Please note that access to all information is by definition confusing for the user, and the fact that ext4 is written here does not mean that there will actually be an ext4 system file in this section. You need to create a certain configuration file for d systems, which is called mount unit. There is documentation, but it is very complete, meaning there are no simple examples.

We specify:

  1. What to mount.
  2. Where to mount.
  3. The type (which is optional since it is auto-defined).
  4. Additional mounting parameters.
  5. At what point this mounting occurs.

Note where the units are located – the units in the system are located in two places:

  1. Those that come together in packages (default), they are located in the /lib directory. These are non-modifiable settings that come with packages and related services.
  2. If we want to set our own configuration, we need to write it in the /etc/system/system directory. The classic option for modern Linux is to use UUID (unique file system identifiers). To avoid confusion, if you are mounting an srv, the unit must also be called srv. Check the status with the  systemctl status srv.mount command.

Simple

Simple is just a process that starts and weighs (it's easy to kill and start again). Most of the users in your system that you have just installed are not users, but users with the rights to run various processes.

Journalctl

It lets you view the system log above systemd and -r indicates to view it backwards.

If you have a TCP connection open, it guarantees you the integrity and order of the data, and this means that we can write to the data stream using write and then read using read.

When we use template, we create a temporary new service for each regular service launch, and we can describe some of the different parameters that are used in this service.

In addition to the systemd of the General system, which controls the behavior of the operating system to its normal state, suddenly, your operating system is also running your own systemd, which without any superuser, your normal user allows you to use all the same. systemctl --user shows quite a lot of some services for which it is responsible; some of them are enumerated devices.

Timer activation means that you have an event running once in a certain time.

Before us there are two ways to deploy the system:

  1. To write everything on shell (arrange a garland of shell scripts)
  2. To nail the logic of the system deployment (put it in the head of some special service that does this, such as systemd) and describe the deployment of the system in the dark configuration files of this most common startup. This can be done at the operating system level, or it can be done at the individual user level.

HSE/ArchitectureOS/06_SystemdServices/Conspect_en (последним исправлял пользователь VasilyKireenko 2020-06-10 01:14:58)