Merge lp:~wgrant/launchpad/what-the-distromirror into lp:launchpad

Proposed by William Grant on 2012-05-17
Status: Merged
Approved by: Curtis Hovey on 2012-05-17
Approved revision: no longer in the source branch.
Merged at revision: 15266
Proposed branch: lp:~wgrant/launchpad/what-the-distromirror
Merge into: lp:launchpad
Diff against target: 100 lines (+3/-76)
2 files modified
cronscripts/mirror-prober.sh (+0/-53)
cronscripts/nightly.sh (+3/-23)
To merge this branch: bzr merge lp:~wgrant/launchpad/what-the-distromirror
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code 2012-05-17 Approve on 2012-05-17
Review via email: mp+106086@code.launchpad.net

Commit Message

Drop some production-specific (bits of) cronscripts.

Description of the Change

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.

To post a comment you must log in.
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'cronscripts/mirror-prober.sh'
2--- cronscripts/mirror-prober.sh 2011-02-08 19:23:57 +0000
3+++ cronscripts/mirror-prober.sh 1970-01-01 00:00:00 +0000
4@@ -1,53 +0,0 @@
5-#!/bin/sh
6-#
7-# Copyright 2009 Canonical Ltd. This software is licensed under the
8-# GNU Affero General Public License version 3 (see the file LICENSE).
9-
10-# This script runs the mirror prober scripts as the
11-# launchpad user every two hours. Typically the output
12-# will be sent to an email address for inspection.
13-
14-# Only run this script on loganberry
15-THISHOST=$(uname -n)
16-if [ "loganberry" != "$THISHOST" ]
17-then
18- echo "This script must be run on loganberry."
19- exit 1
20-fi
21-
22-# Only run this as the launchpad user
23-USER=$(whoami)
24-if [ "launchpad" != "$USER" ]
25-then
26- echo "Must be launchpad user to run this script."
27- exit 1
28-fi
29-
30-
31-export LPCONFIG=distromirror
32-export http_proxy=http://squid.internal:3128/
33-export ftp_proxy=http://squid.internal:3128/
34-
35-LOGFILE=/srv/launchpad.net/production-logs/mirror-prober.log
36-
37-LOCK=/var/lock/launchpad_mirror_prober.lock
38-lockfile -r0 -l 259200 $LOCK
39-if [ $? -ne 0 ]; then
40- echo $(date): Unable to grab $LOCK lock - aborting | tee -a $LOGFILE
41- ps fuxwww
42- exit 1
43-fi
44-
45-cd /srv/launchpad.net/production/launchpad/cronscripts
46-
47-echo $(date): Grabbed lock >> $LOGFILE
48-
49-echo $(date): Probing archive mirrors >> $LOGFILE
50-python -S distributionmirror-prober.py -q --content-type=archive --max-mirrors=20 --log-file=DEBUG:$LOGFILE
51-
52-echo $(date): Probing cdimage mirrors >> $LOGFILE
53-python -S distributionmirror-prober.py -q --content-type=cdimage --max-mirrors=30 --log-file=DEBUG:$LOGFILE
54-
55-echo $(date): Removing lock >> $LOGFILE
56-rm -f $LOCK
57-
58
59=== modified file 'cronscripts/nightly.sh'
60--- cronscripts/nightly.sh 2011-02-03 11:20:10 +0000
61+++ cronscripts/nightly.sh 2012-05-17 02:09:21 +0000
62@@ -10,28 +10,8 @@
63 # Note that http/ftp proxies are needed by the product
64 # release finder
65
66-# Only run this script on loganberry
67-THISHOST=$(uname -n)
68-if [ "loganberry" != "$THISHOST" ]
69-then
70- echo "This script must be run on loganberry."
71- exit 1
72-fi
73-
74-# Only run this as the launchpad user
75-USER=$(whoami)
76-if [ "launchpad" != "$USER" ]
77-then
78- echo "Must be launchpad user to run this script."
79- exit 1
80-fi
81-
82-
83-export LPCONFIG=production
84-export http_proxy=http://squid.internal:3128/
85-export ftp_proxy=http://squid.internal:3128/
86-
87-LOGDIR=/srv/launchpad.net/production-logs/nightly
88+
89+LOGDIR=$1
90 LOGFILE=$LOGDIR/nightly.log
91
92 LOCK=/var/lock/launchpad_nightly.lock
93@@ -42,7 +22,7 @@
94 exit 1
95 fi
96
97-cd /srv/launchpad.net/production/launchpad/cronscripts
98+cd `dirname $0`
99
100 echo $(date): Grabbed lock >> $LOGFILE
101