After five months of development, Systemd 254 has been released by its developers. The most notable feature in this new version is the introduction of the soft restart mode, which allows for the restart of user space components without affecting the Linux kernel. By skipping the initialization stages such as equipment initialization, bootloader calling, kernel startup, driver loading, firmware loading, and Initrd processing, the restart process is significantly accelerated, reducing the time needed for the environment to utilize preconfigured system images.
The soft restart mode enables the completion of all user space processes before replacing the root file system image with a new version (mounted in /run/Nextroot/). This allows for the initialization of the system without having to reboot the kernel. The ability to maintain the state of the running kernel while replacing the user environment enables the updating of certain services in live mode, without the need to stop them. In addition, it facilitates the transfer of file descriptors and listening network sockets from the old environment to the new one. To update the kernel in combination with soft rebooting, the LivePatch mechanism is proposed. It allows for corrections to be made to the running Linux kernel without rebooting or stopping applications.
Other changes introduced in this new version include:
- The addition of the “Systemd-Battery-Check” utility, which checks the battery level. This utility can be launched at the early stage of loading (from Initrd) to prevent the system from loading at a very low charge level. A warning is displayed and the system is turned off after 10 seconds.
- The introduction of the MemoryPressurewatch and MemoryPressurethresholdsec settings for service units, which control the logic of the PSI subsystem (Pressure Stall Information) for individual services. PSI provides information about the resource expectations of various resources (CPU, memory, input/output) to accurately assess the workload level. This allows the identification of resource scarcity-related delays and enables the selective termination of resource-intensive processes before the system reaches a critical condition and starts evicting data from the cache to the swap partition.
- The addition of the “–when” option to the Reboot, Kexec, Poweroff, and Halt commands in the Systemctl utility. This option allows for the scheduling of restarts or shut downs.