FS#61694 - [systemd] mkinitcpio "systemd" build hook does not handle "special characters" in Exec* options
Attached to Project:
Arch Linux
Opened by Marcel Röthke (mroethke) - Saturday, 09 February 2019, 21:04 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:13 GMT
Opened by Marcel Röthke (mroethke) - Saturday, 09 February 2019, 21:04 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:13 GMT
|
Details
Description:
Exec* option in systemd service files can have "special characters" (!, !!, @,- , +) directly after the "=", they alter systemds behavior and have nothing to do with the binary path. This is documented in the man page systemd.service under "ExecStart". The function add_systemd_unit from the systemd hook does not handle this and errors out, because it can't find the binary. Additional info: package version: systemd: 240.34-3 mkinitcpio: 25-1 I attached a minimal hook that shows this issue and a simple fix that works for me™. Steps to reproduce: 1. Write an mkinitcpio hook that uses add_systemd_unit with "special characters" in Exec* options e.g. systemd-networkd.service 2. Add custom hook to to hooks array 2. rebuild initramfs |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:13 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/systemd/issues/4
Saturday, 25 November 2023, 20:13 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/systemd/issues/4
echo "${values[0]##+([^/a-zA-Z0-9])}"
If you don't want to use extglob:
prefix="${values[0]%%[/a-zA-Z0-9]*}"
idx=${#prefix}
echo "${values[0]:idx}"