]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/buildd/files/buildd-schroot-aptitude-kill.squeeze
Fix stomping of certfile
[dsa-puppet.git] / modules / buildd / files / buildd-schroot-aptitude-kill.squeeze
index 032c5a5c80911a979095b98609bd0035dde0a3c6..0be841f69e43afd6a09e56f4ce7da927271366f9 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 schroots=$(pgrep -x -u 0 schroot -d ',')
-pgrep -x -u 0 -P "$schroots" aptitude | xargs ps h -o 'pid,vsz,cputime' | while read pid vsz cputime; do
+pgrep -x -u 0 -P "$schroots" aptitude | xargs --no-run-if-empty ps h -o 'pid,vsz,cputime' | while read pid vsz cputime; do
   mb=$((vsz/1024))
   [ "$mb" -lt 250 ] && continue
   hours=${vsz%%:*}
@@ -9,6 +9,6 @@ pgrep -x -u 0 -P "$schroots" aptitude | xargs ps h -o 'pid,vsz,cputime' | while
   mins=${nohours%:*}
 
   if [ "$hours" -gt 0 ] || [ "$mins" -gt 15 ]; then
-    kill $pid
+    kill "$pid"
   fi
 done