TEST-26-SYSTEMCTL: Create /etc/init.d if needed

OpenSUSE doesn't disable sysv compat but also may not have anything in
/etc/init.d.
This commit is contained in:
Richard Maw 2024-04-24 14:44:27 +01:00
parent dcb17e3295
commit 4114b723f9

View file

@ -386,6 +386,10 @@ if [[ -x /usr/lib/systemd/system-generators/systemd-sysv-generator ]]; then
# at runtime, so let's just support the two most common paths for now.
[[ -d /etc/rc.d/init.d ]] && SYSVINIT_PATH="/etc/rc.d/init.d" || SYSVINIT_PATH="/etc/init.d"
# OpenSUSE leaves sysvinit-path enabled, which means systemd-sysv-generator is built
# but may not create the directory if there's no services that use it.
mkdir -p "$SYSVINIT_PATH"
# invalid dependency
cat >"${SYSVINIT_PATH:?}/issue-24990" <<\EOF
#!/bin/bash