Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#76142 - [systemd] v251.5-1 Inicpio install hook isn't properly adding service overrides

Attached to Project: Arch Linux
Opened by Christian Påbøl Jacobsen (cpebble) - Saturday, 08 October 2022, 17:51 GMT
Last edited by Toolybird (Toolybird) - Sunday, 09 October 2022, 03:56 GMT
Task Type Bug Report
Category Packages: Core
Status Assigned
Assigned To Christian Hesse (eworm)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


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 "" 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:
1. Override a service by "systemctl edit xxx.service"
2. Call "add_systemd_unit xxx.service" in an initcpio hook
3. Browse lsinitcpio and confirm no override is copied

This task depends upon

Comment by Toolybird (Toolybird) - Sunday, 09 October 2022, 03:56 GMT
The use case seems a bit niche. Supplying a tested patch would likely increase the chances of this being implemented.
Comment by Christian Påbøl Jacobsen (cpebble) - Sunday, 09 October 2022, 10:37 GMT
Niche isn't far off, however with Poetterings focus on encryption and security, I'm guessing we'll see more and more systemd services to be run this early.

I'll provide a patch