[Piuparts-commits] [piuparts] 06/08: reschedule_oldest_logs: use a temporary file to avoid SIGCHLD

Holger Levsen holger at moszumanska.debian.org
Mon Jul 20 08:48:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 69174c737eafd19eff36669bc26c75e1500e76d6
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Jul 19 22:57:35 2015 +0200

    reschedule_oldest_logs: use a temporary file to avoid SIGCHLD
    
    avoids:
      xargs: ls: terminated by signal 13
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 master-bin/reschedule_oldest_logs.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/master-bin/reschedule_oldest_logs.in b/master-bin/reschedule_oldest_logs.in
index cd09dea..3b2da94 100755
--- a/master-bin/reschedule_oldest_logs.in
+++ b/master-bin/reschedule_oldest_logs.in
@@ -53,6 +53,7 @@ is_recent()
 }
 
 
+TMPLIST=$(mktemp)
 list_logs()
 {
 	__AGE="$1"
@@ -61,7 +62,8 @@ list_logs()
 	find "$@" -name "*.log" -mtime +$__AGE \
 		| tac \
 		| xargs --no-run-if-empty -n99999 -s1999999 ls -dt \
-		| tail -n $__COUNT
+		> $TMPLIST
+	tail -n $__COUNT $TMPLIST
 }
 
 
@@ -163,6 +165,7 @@ for SECTION in $SECTIONS ; do
 	cd $OLDPWD
 done
 rm $RECENT
+rm $TMPLIST
 rm $LOGS
 rm $OBSOLETE
 rm $EXPIRED

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list