From c918af6ac77c75eecb7977e0c2f776e585040de0 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 14 Jan 2017 22:42:07 +0100 Subject: reproducible Debian: test whether /run/shm is a link pointing to /dev/shm, thanks #851427 Signed-off-by: Holger Levsen --- bin/reproducible_maintenance.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 6386c2a2..d747fa59 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -53,6 +53,10 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then fi show_fstab_and_mounts() { + echo "################################" + echo "/dev/shm and /run/shm on $HOSTNAME" + echo "################################" + ls -lartd /run/shm /dev/shm/ echo "################################" echo "/etc/fstab on $HOSTNAME" echo "################################" @@ -61,6 +65,7 @@ show_fstab_and_mounts() { echo "mount output on $HOSTNAME" echo "################################" mount + echo "################################" } # for Debian, first run some checks… @@ -79,11 +84,10 @@ if [ $? -ne 0 ] ; then echo "Warning: /dev/shm is not mounted correctly on $HOSTNAME, please tell the jenkins admins to fix this." show_fstab_and_mounts fi -# check for /run/shm being mounted properly -echo "$(date -u) - testing whether /run/shm is mounted correctly..." -mount | egrep -q "^tmpfs on /run/shm" && test "$(stat -c %a -L /run/shm)" = 1777 -if [ $? -ne 0 ] ; then - echo "Warning: /run/shm is not mounted correctly on $HOSTNAME, please tell the jenkins admins to fix this." +# check for /run/shm being a link to /dev/shm +echo "$(date -u) - testing whether /run/shm is a link..." +if ! test -L /run/shm || [ "$(readlink /run/shm)" != "/dev/shm" ] ; then + echo "Warning: /run/shm not a link or not pointing to /dev/shm on $HOSTNAME, please tell the jenkins admins to fix this." show_fstab_and_mounts fi -- cgit v1.2.3-54-g00ecf