← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/the-silence-of-the-probers into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/the-silence-of-the-probers into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #712882 mirror-prober.sh is too noisy
  https://bugs.launchpad.net/bugs/712882

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/the-silence-of-the-probers/+merge/48571

This branch silences mirror-prober.sh, redirecting non-error output to mirror-prober.log. Maybe cron will shut up now. I also updated the rest of the script to use $() instead of ``, since mthaddon says that the former is preferred.
-- 
https://code.launchpad.net/~wgrant/launchpad/the-silence-of-the-probers/+merge/48571
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/the-silence-of-the-probers into lp:launchpad.
=== modified file 'cronscripts/mirror-prober.sh'
--- cronscripts/mirror-prober.sh	2010-05-19 18:07:56 +0000
+++ cronscripts/mirror-prober.sh	2011-02-04 03:01:37 +0000
@@ -8,7 +8,7 @@
 # will be sent to an email address for inspection.
 
 # Only run this script on loganberry
-THISHOST=`uname -n`
+THISHOST=$(uname -n)
 if [ "loganberry" != "$THISHOST" ]
 then
         echo "This script must be run on loganberry."
@@ -16,7 +16,7 @@
 fi
 
 # Only run this as the launchpad user
-USER=`whoami`
+USER=$(whoami)
 if [ "launchpad" != "$USER" ]
 then
         echo "Must be launchpad user to run this script."
@@ -28,21 +28,26 @@
 export http_proxy=http://squid.internal:3128/
 export ftp_proxy=http://squid.internal:3128/
 
+LOGFILE=/srv/launchpad.net/production-logs/mirror-prober.log
+
 LOCK=/var/lock/launchpad_mirror_prober.lock
 lockfile -r0 -l 259200 $LOCK
 if [ $? -ne 0 ]; then
-    echo Unable to grab $LOCK lock - aborting
+    echo $(date): Unable to grab $LOCK lock - aborting | tee -a $LOGFILE
     ps fuxwww
     exit 1
 fi
 
 cd /srv/launchpad.net/production/launchpad/cronscripts
 
-echo '== Distribution mirror prober (archive)' `date` ==
-python -S distributionmirror-prober.py --content-type=archive --max-mirrors=20
-
-echo '== Distribution mirror prober (cdimage)' `date` ==
-python -S distributionmirror-prober.py --content-type=cdimage --max-mirrors=30
-
+echo $(date): Grabbed lock >> $LOGFILE
+
+echo $(date): Probing archive mirrors >> $LOGFILE
+python -S distributionmirror-prober.py -q --content-type=archive --max-mirrors=20 --log-file=DEBUG:$LOGFILE
+
+echo $(date): Probing cdimage mirrors >> $LOGFILE
+python -S distributionmirror-prober.py -q --content-type=cdimage --max-mirrors=30 --log-file=DEBUG:$LOGFILE
+
+echo $(date): Removing lock >> $LOGFILE
 rm -f $LOCK