launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #07943
[Merge] lp:~wgrant/launchpad/what-the-distromirror into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/what-the-distromirror into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/what-the-distromirror/+merge/106086
cronscripts/mirror-prober.sh and cronscripts/nightly.sh have hardcoded production configuration and refuse to run except on loganberry. This is silly.
https://pastebin.canonical.com/66225/ was recently applied to the crontabs, eliminating the need for mirror-prober.sh, and letting nightly.sh inherit envvars and take its logdir as a parameter. So we can remove one script, and rip production-specific stuff out of the other.
--
https://code.launchpad.net/~wgrant/launchpad/what-the-distromirror/+merge/106086
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/what-the-distromirror into lp:launchpad.
=== removed file 'cronscripts/mirror-prober.sh'
--- cronscripts/mirror-prober.sh 2011-02-08 19:23:57 +0000
+++ cronscripts/mirror-prober.sh 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2009 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-# This script runs the mirror prober scripts as the
-# launchpad user every two hours. Typically the output
-# will be sent to an email address for inspection.
-
-# Only run this script on loganberry
-THISHOST=$(uname -n)
-if [ "loganberry" != "$THISHOST" ]
-then
- echo "This script must be run on loganberry."
- exit 1
-fi
-
-# Only run this as the launchpad user
-USER=$(whoami)
-if [ "launchpad" != "$USER" ]
-then
- echo "Must be launchpad user to run this script."
- exit 1
-fi
-
-
-export LPCONFIG=distromirror
-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 $(date): Unable to grab $LOCK lock - aborting | tee -a $LOGFILE
- ps fuxwww
- exit 1
-fi
-
-cd /srv/launchpad.net/production/launchpad/cronscripts
-
-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
-
=== modified file 'cronscripts/nightly.sh'
--- cronscripts/nightly.sh 2011-02-03 11:20:10 +0000
+++ cronscripts/nightly.sh 2012-05-17 02:09:21 +0000
@@ -10,28 +10,8 @@
# Note that http/ftp proxies are needed by the product
# release finder
-# Only run this script on loganberry
-THISHOST=$(uname -n)
-if [ "loganberry" != "$THISHOST" ]
-then
- echo "This script must be run on loganberry."
- exit 1
-fi
-
-# Only run this as the launchpad user
-USER=$(whoami)
-if [ "launchpad" != "$USER" ]
-then
- echo "Must be launchpad user to run this script."
- exit 1
-fi
-
-
-export LPCONFIG=production
-export http_proxy=http://squid.internal:3128/
-export ftp_proxy=http://squid.internal:3128/
-
-LOGDIR=/srv/launchpad.net/production-logs/nightly
+
+LOGDIR=$1
LOGFILE=$LOGDIR/nightly.log
LOCK=/var/lock/launchpad_nightly.lock
@@ -42,7 +22,7 @@
exit 1
fi
-cd /srv/launchpad.net/production/launchpad/cronscripts
+cd `dirname $0`
echo $(date): Grabbed lock >> $LOGFILE
Follow ups