[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.47-40-g31a624f

Andreas Beckmann debian at abeckmann.de
Thu Nov 29 15:29:31 UTC 2012


The following commit has been merged in the piatti branch:
commit 06bfe2e67b547a9a2891f206141dd222a1bad133
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Oct 5 21:41:39 2012 +0200

    master/slave scripts: consistently use PIUPARTS_TMPDIR
    
    get it from piuparts.conf [global] tmpdir
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/master-bin/detect_stale_mounts b/master-bin/detect_stale_mounts
index d139808..a7800a8 100755
--- a/master-bin/detect_stale_mounts
+++ b/master-bin/detect_stale_mounts
@@ -36,16 +36,16 @@ get_config_value()
 	eval "$1"='"$value"'
 }
 
-get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
+get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
 
 
 FILE=`mktemp`
 cp /proc/mounts $FILE
 
-if [ "$(grep -v trash $FILE | grep -c $PIUPARTS_TEMPDIR )" -gt 1 ] ; then
-	echo "More than one mountpoint below $PIUPARTS_TEMPDIR detected!"
+if [ "$(grep -v trash $FILE | grep -c "$PIUPARTS_TMPDIR" )" -gt 1 ] ; then
+	echo "More than one mountpoint below $PIUPARTS_TMPDIR detected!"
 	echo
-	grep $PIUPARTS_TEMPDIR $FILE
+	grep "$PIUPARTS_TMPDIR" $FILE
 	echo
 	echo "Zero or one mountpoint is normal for piuparts operation, more is not."
 	echo "Please investigate and cleanup."
diff --git a/master-bin/detect_tmp_cruft b/master-bin/detect_tmp_cruft
index e628310..5d07ba3 100755
--- a/master-bin/detect_tmp_cruft
+++ b/master-bin/detect_tmp_cruft
@@ -36,16 +36,16 @@ get_config_value()
 	eval "$1"='"$value"'
 }
 
-get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
+get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
 
 
-LS_TMP=$(ls --color=never -l $PIUPARTS_TEMPDIR)
+LS_TMP=$(ls --color=never -l "$PIUPARTS_TMPDIR")
 if [ "$(echo "$LS_TMP" | wc -l)" -gt 12 ] ; then
-	echo "More than ten directories in $PIUPARTS_TEMPDIR detected!"
+	echo "More than ten directories in $PIUPARTS_TMPDIR detected!"
 	echo
 	echo "$LS_TMP"
 	echo
-	echo "$(du -shx $PIUPARTS_TEMPDIR 2>/dev/null)"
+	echo "$(du -shx "$PIUPARTS_TMPDIR" 2>/dev/null)"
 	echo
 	echo "One is normal for piuparts operation, more is not."
 	echo "Please investigate and cleanup."
diff --git a/slave-bin/detect_leftover_processes b/slave-bin/detect_leftover_processes
index a65baa4..9875987 100755
--- a/slave-bin/detect_leftover_processes
+++ b/slave-bin/detect_leftover_processes
@@ -37,7 +37,7 @@ get_config_value()
 }
 
 get_config_value MASTER global master-directory
-get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
+get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
 
 #
 # find processes running in deleted chroots
@@ -47,9 +47,9 @@ get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
 MONITORDIR=$MASTER/monitor-slave
 LOCKFILE="$MONITORDIR/leftover_processes"
 
-OUTPUT=$(sudo ls  --color=never -lad /proc/*/root 2>/dev/null|grep "$PIUPARTS_TEMPDIR" | grep "(deleted)")
+OUTPUT=$(sudo ls  --color=never -lad /proc/*/root 2>/dev/null|grep "$PIUPARTS_TMPDIR" | grep "(deleted)")
 if [ "$OUTPUT" != "" ] && [ "$(cat $LOCKFILE)" != "$OUTPUT" ] ; then
-	echo "Found processes running with a deleted chroot in $PIUPARTS_TEMPDIR"
+	echo "Found processes running with a deleted chroot in $PIUPARTS_TMPDIR"
 	echo "This is usually because of 'FAIL: Processes are running inside chroot' which usually"
 	echo "means the packages violates 'must use invoke-rc.d (policy 9.3.3.2)'."
 	echo
diff --git a/slave-bin/slave_cleanup b/slave-bin/slave_cleanup
index 50cda74..6b7f6bc 100755
--- a/slave-bin/slave_cleanup
+++ b/slave-bin/slave_cleanup
@@ -48,16 +48,16 @@ get_config_value()
 	eval "$1"='"$value"'
 }
 
-get_config_value PIUPARTS_TEMPDIR global tempdir /org/piuparts.debian.org/tmp
+get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
 
 
 # umount all mount points (should be none on boot, but this script can also be called at other times)
-for MOUNTPOINT in $(tac /proc/mounts | cut -d " " -f 2 | grep $PIUPARTS_TEMPDIR/)
+for MOUNTPOINT in $(tac /proc/mounts | cut -d " " -f 2 | grep "$PIUPARTS_TMPDIR/")
 do
-	sudo umount $MOUNTPOINT
+	sudo umount "$MOUNTPOINT"
 done
 
 # cleanup tmp
-sudo rm -rf --one-file-system $PIUPARTS_TEMPDIR
-mkdir -p $PIUPARTS_TEMPDIR
+sudo rm -rf --one-file-system "$PIUPARTS_TMPDIR"
+mkdir -p "$PIUPARTS_TMPDIR"
 
diff --git a/update-piuparts-setup b/update-piuparts-setup
index 35c2f59..0051e97 100755
--- a/update-piuparts-setup
+++ b/update-piuparts-setup
@@ -28,7 +28,7 @@ fi
 
 PIUPARTS_PREFIX=/org/piuparts.debian.org
 PIUPARTS_HTDOCS=$PIUPARTS_PREFIX/htdocs
-PIUPARTS_TEMPDIR=$PIUPARTS_PREFIX/tmp
+PIUPARTS_TMPDIR=$PIUPARTS_PREFIX/tmp
 
 # please cleanup yourself
 cd
@@ -101,7 +101,7 @@ done
 #
 # create working dir
 #
-mkdir -p $PIUPARTS_TEMPDIR
+mkdir -p $PIUPARTS_TMPDIR
 
 #
 # update slave home

-- 
piuparts git repository



More information about the Piuparts-commits mailing list