From: Franck Bui Date: Tue, 6 Feb 2024 13:46:53 +0000 (+0100) Subject: test: systemd-update-utmp is optional X-Git-Tag: v256-rc1~956 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e374109efb582f3f3a417fd3f8c71121873c7b0c;p=thirdparty%2Fsystemd.git test: systemd-update-utmp is optional It can be disabled with '-Dutmp=false' --- diff --git a/test/units/testsuite-01.sh b/test/units/testsuite-01.sh index 870b62da9ab..bb3ff2f1e9e 100755 --- a/test/units/testsuite-01.sh +++ b/test/units/testsuite-01.sh @@ -48,14 +48,16 @@ systemd-analyze blame # Test for 'systemd-update-utmp runlevel' vs 'systemctl daemon-reexec'. # See issue #27163. # shellcheck disable=SC2034 -for _ in {0..10}; do - systemctl daemon-reexec & - pid_reexec=$! - # shellcheck disable=SC2034 +if [[ -x /usr/lib/systemd/systemd-update-utmp ]]; then for _ in {0..10}; do - SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-update-utmp runlevel + systemctl daemon-reexec & + pid_reexec=$! + # shellcheck disable=SC2034 + for _ in {0..10}; do + SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-update-utmp runlevel + done + wait "$pid_reexec" done - wait "$pid_reexec" -done +fi touch /testok