Systemd file triggers
Summary
systemd daemon-reload is invoked once or twice per rpm transaction.
Owner
- Name: Zbigniew Jędrzejewski-Szmek
- Email: zbyszek@in.waw.pl
- Release notes owner:
Current status
Detailed Description
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.
Packages still have to call systemctl preset as necessary, and try-restart on their own unit if appropriate. RPM macros provided by systemd are modified to remove all calls to daemon-reload from them. No changes to packages using those macros are required, but a rebuild is necessary to remove the calls to systemctl daemon-reload.
Benefit to Fedora
Faster installation of packages.
Scope
- Proposal owners:
Update the macros provided by systemd and add appropriate file triggers.
- Other developers: potentially rebuild some packages.
- Release engineering: N/A
- List of deliverables: N/A
- Policies and guidelines: N/A
- Trademark approval: N/A (not needed for this Change)
Upgrade/compatibility impact
Packages have to be rebuilt to use the new macros. Until that happens, extra reloads will be issued. In addition, the difference in behaviour will happen on the next update, since during the first upgrade after the change old scriptlets will be used.
How To Test
Upgrade packages. Look for systemd[1]: Reloading.. Verify that the reload happens at least once, and that the reload happens before upgraded units are restarted (units should be restarted to use the new binaries and daemon-reload should happen first so that updated units are used if they changed).
User Experience
N/A (not user visible)
Dependencies
Contingency Plan
- Contingency mechanism: Restore old macros, rebuild all packages using systemd macros (everything which BR:systemd ?).
- Contingency deadline: beta
- Blocks release? No
- Blocks product? No
Documentation
- https://github.com/systemd/systemd/pull/1909
- https://bugzilla.redhat.com/show_bug.cgi?id=1282115
- http://www.rpm.org/wiki/FileTriggers
Why make this into a Change at all?
This has effect on scripts in all packages using systemd macros, and people might be surprised if they suddenly see the macros turned to %{nil} or significantly shortened. A rebuild of many packages is also required for the change to actually matter.