From 09992e92e56cc9047eb7ffa4426dcd976adb8f88 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 11 Jan 2013 15:44:59 +0100 Subject: wait until there is no such process running --- bin/housekeeping.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/housekeeping.sh b/bin/housekeeping.sh index 5bce9dfa..b03e16e0 100755 --- a/bin/housekeeping.sh +++ b/bin/housekeeping.sh @@ -58,6 +58,14 @@ report_squid_usage() { fi } +wait4idle() { + echo "Waiting until no $1.sh process runs.... $(date)" + while [ $(ps fax | grep -c $1.sh) -gt 1 ] ; do + sleep 30 + done + echo "Done waiting: $(date)" +} + general_housekeeping() { echo uptime @@ -89,10 +97,12 @@ if [ -z $1 ] ; then report_squid_usage brief else case $1 in - chroot-installation) report_disk_usage $1 + chroot-installation) wait4idle $1 + report_disk_usage $1 check_for_mounted_chroots $1 ;; - g-i-installation) report_disk_usage $1 + g-i-installation) wait4idle $1 + report_disk_usage $1 report_filetype_usage $1 raw warn report_filetype_usage $1 iso report_filetype_usage $1 png -- cgit v1.2.3-70-g09d2