summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintenance.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-12 21:31:12 +0200
committerHolger Levsen <holger@layer-acht.org>2015-06-14 21:55:26 +0200
commit7fc7fb0c59266664b8c700e21859a7fbcc3d5052 (patch)
treea18c9e48228f06f39c2679208f88008cd5c8a502 /bin/reproducible_maintenance.sh
parented7f36ad6ac69972414ff11eea911a22a25d26f1 (diff)
downloadjenkins.debian.net-7fc7fb0c59266664b8c700e21859a7fbcc3d5052.tar.xz
reproducible: define $TEMPDIR as /tmp/reproducible and teach all the to create temporary files under TEMPDIR (except for builders, they have their own TMPDIR), to avoid polluting /tmp
Diffstat (limited to 'bin/reproducible_maintenance.sh')
-rwxr-xr-xbin/reproducible_maintenance.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 63e8398b..49817707 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -89,9 +89,9 @@ if [ ! -z "$FAILED_BUILDS" ] ; then
fi
# find+terminate processes which should not be there
-HAYSTACK=$(mktemp)
-RESULT=$(mktemp)
-TOKILL=$(mktemp)
+HAYSTACK=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXX)
+RESULT=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXX)
+TOKILL=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXX)
PBUIDS="1234 1111 2222"
ps axo pid,user,size,pcpu,cmd > $HAYSTACK
for i in $PBUIDS ; do
@@ -152,7 +152,7 @@ QUERY="
AND p.date_build_started < datetime('now', '-36 hours')
ORDER BY p.date_scheduled
"
-PACKAGES=$(mktemp)
+PACKAGES=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY" > $PACKAGES 2> /dev/null || echo "Warning: SQL query '$QUERY' failed."
if grep -q '|' $PACKAGES ; then
echo
@@ -179,7 +179,7 @@ if [ ! -z "$LOCKFILES" ] ; then
fi
# find packages which have been removed from the archive
-PACKAGES=$(mktemp)
+PACKAGES=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXX)
QUERY="SELECT name, suite, architecture FROM removed_packages
LIMIT 25"
sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY" > $PACKAGES 2> /dev/null || echo "Warning: SQL query '$QUERY' failed."