Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

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

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#65978 - [systemd] add_systemd_unit in mkinitcpio hook ignores units in /etc/systemd/system

Attached to Project: Arch Linux
Opened by Sebastian Wiesner (lunaryorn) - Wednesday, 25 March 2020, 17:18 GMT
Last edited by freswa (frederik) - Wednesday, 25 March 2020, 19:42 GMT
Task Type Bug Report
Category Packages: Core
Status Assigned
Assigned To Dave Reisner (falconindy)
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

Details

Description:

`add_systemd_unit` ignores administrator-created units from `/etc/systemd/system/`; I guess because `/etc/systemd/system` is missing in `unit=` at the beginning of `add_systemd_unit` (see https://git.archlinux.org/svntogit/packages.git/tree/trunk/initcpio-install-systemd?h=packages/systemd#n55).

Was it omitted on purpose, or would it be possible to include `/etc/systemd/system` units in `add_systemd_unit`?

I'd like to add a custom mkinitcpio hook and service to print my contact info before the LUKS prompt; I could build a small AUR package for this but since it's just two files and both systemd and mkinitcpio read from /etc I figured a package would be overkill, and I could just add those two files directly. However that didn't work because `add_systemd_unit` never picked up my custom service.

As a workaround I copied relevant parts of `add_systemd_unit` to my own install hook so I'm fine, but I think in general picking up (static) units from all the places systemd looks for would be the right thing to do, wouldn't it?

Steps to reproduce:

1. Create a custom service file in `/etc/systemd/system/foo.service`
2. Create a custom install hook in `/etc/initcpio/install/foo` which invokes `add_systemd_unit foo.service || exit 1`
3. Run `mkinitcpio` and see it fail in `foo`.
This task depends upon

Loading...