install/systemd: Inicpio install hook isn't properly adding service overrides
Task Info (Flyspray) | |
---|---|
Opened By | Christian Påbøl Jacobsen (cpebble) |
Task ID | 76142 |
Type | Bug Report |
Project | Arch Linux |
Category | Packages: Core |
Version | None |
OS | All |
Opened | 2022-10-08 17:51:54 UTC |
Status | Assigned |
Assignee | Christian Hesse (eworm) |
Details
When using the "add_systemd_unit" initpcio function, the systemd unit is added to the initramfs. However if that unit has an override defined in /etc/systemd/system, that override isn't correctly carried over. The code for add_systemd_unit is in /usr/lib/initcpio/install/systemd. That file also have an "add_systemd_drop_in" which isn't used, but can be used to implement this.
The bug was discovered after trying to add a service (pcscd - smart card daemon) to boot. Normally it would depend on "sockets.target" and systemd won't start it during launch. Adding an override with "defaultdependencies=no" and a new "RequiredBy" would let the service start, but it isn't copied to initramfs.
A fix can be made by simply checking the /etc/ directory on call to "add_systemd_unit"
Steps to reproduce:
- Override a service by "systemctl edit xxx.service"
- Call "add_systemd_unit xxx.service" in an initcpio hook
- Browse lsinitcpio and confirm no override is copied