Merge ~rodsmith/maas-cert-server:fix-apt-mirror-failure into maas-cert-server:master

Proposed by Rod Smith
Status: Merged
Approved by: Jeff Lane 
Approved revision: 604ba8aaa0c480e3deee17c015ea64872aabbee8
Merged at revision: 223c6a281516707563f8a81d935224d10bcdbaba
Proposed branch: ~rodsmith/maas-cert-server:fix-apt-mirror-failure
Merge into: maas-cert-server:master
Diff against target: 57 lines (+12/-17)
2 files modified
debian/changelog (+6/-0)
usr/sbin/maniacs-setup (+6/-17)
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+347659@code.launchpad.net

Description of the change

This fixes a problem with the APT mirror operation brought on by pushing that operation into the background. Note that a few niceties are now impossible with the APT mirror occurring in the background -- old mirror contents can't be cleaned up, mainly, at least not without monitoring the download and kicking off the clean-up process when it's done.

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

thanks for cleaning that up so quickly

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0dec1e5..05eac75 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+maas-cert-server (0.3.4-0ppa1) bionic; urgency=medium
7+
8+ * The previous MR broke the APT mirror. This should fix it.
9+
10+ -- Rod Smith <rod.smith@canonical.com> Thu, 07 Jun 2018 17:55:06 -0700
11+
12 maas-cert-server (0.3.3-0ppa1) bionic; urgency=medium
13
14 * Update to maniacs-setup so that it downloads the APT mirror,
15diff --git a/usr/sbin/maniacs-setup b/usr/sbin/maniacs-setup
16index cd23a92..631f551 100755
17--- a/usr/sbin/maniacs-setup
18+++ b/usr/sbin/maniacs-setup
19@@ -418,7 +418,7 @@ mirror_archive() {
20 echo "* current mirror config. Be careful choosing the releases to mirror to"
21 echo "* avoid removing a release you are currently mirroring."
22 echo "*"
23- get_yn "* Do you wisk to continue modifying the archive mirror config?" "N"
24+ get_yn "* Do you wish to continue modifying the archive mirror config?" "N"
25 echo
26 else
27 get_yn "* Do you want to mirror an archive site for local use" "N"
28@@ -495,24 +495,13 @@ mirror_archive() {
29 echo "* Creating archive mirror in the background. Check $MIRROR_TRACKER"
30 echo "* for status information."
31 echo "*"
32+ mkdir -p $MCS_DATA
33 apt-mirror &> $MCS_DATA/apt-mirror.out &
34 echo "*"
35- echo "* Mirror operation complete."
36- # If we're re-running to update the mirror, this can free up a lot of
37- # space if we've opted to remove a release from the mirrored archives.
38- if [ -f $ARCHIVE_MIRROR/var/clean.sh ] ; then
39- echo "*"
40- echo "* If you are running this to update the archive mirrors, now we can"
41- echo "* run the cleanup script to remove unneeded archive files and free up"
42- echo "* some disk space."
43- get_yn "Would you like to run the cleanup script now?" "Y"
44- if [ $YN = "Y" ]; then
45- $ARCHIVE_MIRROR/var/clean.sh
46- else
47- echo "* You can run the cleanup script manually any time by running the command"
48- echo "* $ARCHIVE_MIRROR/var/clean.sh."
49- fi
50- fi
51+ echo "* Mirror operation begun."
52+ echo "*"
53+ echo "* After the mirror operation completes, running"
54+ echo "* $ARCHIVE_MIRROR/var/clean.sh can free up some disk space."
55 ln -sf $ARCHIVE_MIRROR/mirror/$MIRROR_HOSTNAME/ubuntu /var/www/html/ubuntu
56 ln -sf $ARCHIVE_MIRROR/mirror/ppa.launchpad.net/* /var/www/html/
57 [ -e $ARCHIVE_MIRROR/mirror/maas.ubuntu.com ] && ln -sf $ARCHIVE_MIRROR/mirror/maas.ubuntu.com /var/www/html/

Subscribers

People subscribed via source and target branches