chiark / gitweb /
autopkgtest: setup-host: clean out possibly-wrong /dev/log
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Feb 2025 01:36:58 +0000 (01:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Feb 2025 19:19:41 +0000 (19:19 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
adt/acommon

index bd863c3ba589db99e0a92cc3784de3dfe807ea62..6541b147dd28805706c4af34968bdd5a7a816f79 100644 (file)
@@ -135,6 +135,16 @@ setup-host () {
          ! test -d /var/cache/apt/archives; then
            rm /var/cache/apt/archives
        fi
+
+       # On systemd systems, /dev/log is a symlink into /run/systemd,
+       # but we cannot run systemd in the inner environment,
+       # so we use rsyslog.  Clean out the symlink.
+       #
+       # The check for systemd is to let this test be less destructive
+       # when run under inadequate isolation on a non-systemd setup.
+        if ls -al /dev/log | grep systemd; then
+           rm -f /dev/log
+       fi
     '
 
     : remove redundant packages