systemd daemon-reload will be invoked only once

Nov 23, 2015 23:55 GMT  ·  By

We reported the other day that the Fedora developers were discussing the splitting of the main systemd package into two new subpackages, systemd-containers and systemd-udev, for the upcoming Fedora 24 Linux operating systems.

As mentioned in the respective article (link above), the first feature proposals for Fedora 24 was published on the project's website, and the second one we want to share with you today is about systemd file triggers.

According to Mr. Jan Kurik, the Fedora developers are now discussing the implementation of systemd file triggers in the OS, which means that systemd daemon-reload will be invoked only once or twice per RPM (RPM Package Manager) transaction.

"Instead of having every package which carries a systemd unit call systemctl daemon-reload on its own, systemd is reloaded just once after installation of all packages, using rpm file triggers on /usr/lib/systemd/system, /etc/systemd/system," said Jan Kurik, Fedora Platform and Program Manager at Red Hat.

Packages still need to call systemctl

Right now, all the packages in Fedora 23 Linux that carry a systemd unit must call the systemctl daemon-reload on their own. So by implementing systemd file triggers in Fedora 24, the systemd init system will be reloaded only once via RPM file triggers placed on the /etc/systemd/system and /usr/lib/systemd/system paths.

RPM packages who need to call the systemctl preset can do so if necessary, restarting only their own systemd unit. On the other hand, RPM macros generated by the systemd init system will be automatically modified to drop all calls to the systemd daemon-reload.

The implementation of systemd file triggers on Fedora 24 Linux will not require developers to modify any RPM package using the system-generated RPM macros. However, they must rebuild them to remove the calls to the systemctl daemon-reload.