]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-26-SYSTEMCTL: Create /etc/init.d if needed
authorRichard Maw <richard.maw@codethink.co.uk>
Wed, 24 Apr 2024 13:44:27 +0000 (14:44 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Fri, 26 Apr 2024 16:25:55 +0000 (17:25 +0100)
OpenSUSE doesn't disable sysv compat but also may not have anything in
/etc/init.d.

test/units/testsuite-26.sh

index 6734aee654fc0e228778db46e45b0260f6d63dda..27aa98edb78c2ef570ba52bb1caddec82c0c96af 100755 (executable)
@@ -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