diff options
author | James Page <james.page@ubuntu.com> | 2012-11-23 16:07:41 +0000 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2012-11-26 13:03:31 +0000 |
commit | 908c9c67eab553877bc5d16e2d52318d1d8ce8f9 (patch) | |
tree | 769265fa969b203d4406bc44cd34f7c689f4f3ac | |
parent | 49a663c4bc1499f974cca254a9c13016c4382a1b (diff) | |
download | vyos-walinuxagent-908c9c67eab553877bc5d16e2d52318d1d8ce8f9.tar.gz vyos-walinuxagent-908c9c67eab553877bc5d16e2d52318d1d8ce8f9.zip |
Import patches-unapplied version 1.1-0ubuntu2 to ubuntu/raring-proposed
Imported using git-ubuntu import.
Changelog parent: 49a663c4bc1499f974cca254a9c13016c4382a1b
New changelog entries:
* Stop upgrades purging walinuxagent meta-data and configuration files
(LP: #1079897):
- d/{control,walinuxagent-data-saver.preinst}: Added
walinuxagent-data-saver package to ensure that agent generated data is
not lost on upgrade by diverting /usr/sbin/waagent during the upgrade
process.
- d/walinuxagent-data-saver.lintian-overrides: Override errors about use
of dpkg-divert in this package.
- d/control: Added Pre-Depends to walinuxagent on walinuxagent-data-saver.
- d/prerm: Stop calling waagent --uninstall during reconfiguration
and upgrade, specify files to remove manually for purge.
- d/postinst: Remove divert of /usr/sbin/waagent prior to completion of
package install.
* d/preinst: If upgrading from package version with unmanaged waagent upstart
configuration stop the agent and remove the upstart configuration.
* d/upstart: Tidied description in upstart job.
-rw-r--r-- | debian/changelog | 21 | ||||
-rw-r--r-- | debian/control | 10 | ||||
-rw-r--r-- | debian/postinst | 5 | ||||
-rw-r--r-- | debian/preinst | 16 | ||||
-rw-r--r-- | debian/prerm | 5 | ||||
-rw-r--r-- | debian/upstart | 4 | ||||
-rw-r--r-- | debian/walinuxagent-data-saver.lintian-overrides | 10 | ||||
-rw-r--r-- | debian/walinuxagent-data-saver.preinst | 16 |
8 files changed, 81 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index f5be404..caab890 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +walinuxagent (1.1-0ubuntu2) raring; urgency=low + + * Stop upgrades purging walinuxagent meta-data and configuration files + (LP: #1079897): + - d/{control,walinuxagent-data-saver.preinst}: Added + walinuxagent-data-saver package to ensure that agent generated data is + not lost on upgrade by diverting /usr/sbin/waagent during the upgrade + process. + - d/walinuxagent-data-saver.lintian-overrides: Override errors about use + of dpkg-divert in this package. + - d/control: Added Pre-Depends to walinuxagent on walinuxagent-data-saver. + - d/prerm: Stop calling waagent --uninstall during reconfiguration + and upgrade, specify files to remove manually for purge. + - d/postinst: Remove divert of /usr/sbin/waagent prior to completion of + package install. + * d/preinst: If upgrading from package version with unmanaged waagent upstart + configuration stop the agent and remove the upstart configuration. + * d/upstart: Tidied description in upstart job. + + -- James Page <james.page@ubuntu.com> Fri, 23 Nov 2012 16:07:41 +0000 + walinuxagent (1.1-0ubuntu1) raring; urgency=low * New upstream version (LP: #1078074, #1077147). diff --git a/debian/control b/debian/control index 2fc595d..a49d3d0 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Homepage: http://go.microsoft.com/fwlink/?LinkId=250998 Package: walinuxagent Architecture: i386 amd64 +Pre-Depends: walinuxagent-data-saver (= ${binary:Version}) Depends: python (>= 2.4), openssl (>=1.0), openssh-server (>=1:5.9p1), @@ -23,3 +24,12 @@ Description: Windows Azure Linux Agent The Windows Azure Linux Agent supports the provisioning and running of Linux VMs in the Windows Azure cloud. This package should be installed on Linux disk images that are built to run in the Windows Azure environment. + +Package: walinuxagent-data-saver +Architecture: i386 amd64 +Depends: ${misc:Depends} +Description: Helper package which ensures safe upgrade for walinuxagent + Early versions of walinuxagent contained a bug the deleted configuration and + data on reconfiguration or upgrade. + . + This package is used to ensure safe upgrades. diff --git a/debian/postinst b/debian/postinst index 263f5a6..20aaccd 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,5 +1,10 @@ #!/bin/sh set -e + +if [ -f /usr/sbin/waagent.save ]; then + dpkg-divert --package walinuxagent-data-saver --rename --remove /usr/sbin/waagent +fi + case "$1" in configure) waagent --setup --force diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..a9573de --- /dev/null +++ b/debian/preinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +# If upgrading from package version +# with unmanaged upstart configuration +# and agent stop the agent and remove +# the upstart configuration. +if [ -f /etc/init/waagent.conf ]; then + stop waagent 2>&1 > /dev/null || true + rm -f /etc/init/waagent.conf +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm index 22c87b2..54d4caa 100644 --- a/debian/prerm +++ b/debian/prerm @@ -3,12 +3,11 @@ set -e case "$1" in purge) rm /etc/waagent.conf > /dev/null || true + rm -rf /var/lib/waagent > /dev/null || true + rm /etc/ssh/*waagent > /dev/null || true ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - if [ -x /usr/sbin/waagent ]; then - waagent --uninstall - fi ;; *) diff --git a/debian/upstart b/debian/upstart index 860d43a..780f19d 100644 --- a/debian/upstart +++ b/debian/upstart @@ -1,6 +1,4 @@ -#walinuxagent - start Windows Azure agent - -description "walinuxagent" +description "Windows Azure Linux agent" author "Ben Howard <ben.howard@canonical.com>" start on mounted MOUNTPOINT=/ diff --git a/debian/walinuxagent-data-saver.lintian-overrides b/debian/walinuxagent-data-saver.lintian-overrides new file mode 100644 index 0000000..6940bb9 --- /dev/null +++ b/debian/walinuxagent-data-saver.lintian-overrides @@ -0,0 +1,10 @@ +# This package exists purely to stop older version of +# walinuxagent purging all local meta-data, sudo config +# and configuration file on upgrade. +# It does this by diverting the waagent binary during the +# upgrade process; the diversion is removed by the walinuxagent +# postinst script. +walinuxagent-data-saver: orphaned-diversion usr/sbin/waagent preinst +walinuxagent-data-saver: diversion-for-unknown-file usr/sbin/waagent preinst:11 +walinuxagent-data-saver: empty-binary-package + diff --git a/debian/walinuxagent-data-saver.preinst b/debian/walinuxagent-data-saver.preinst new file mode 100644 index 0000000..971e899 --- /dev/null +++ b/debian/walinuxagent-data-saver.preinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +if [ -f /usr/sbin/waagent ]; then + # Divert the waagent binary so that the prerm script + # in earlier versions of walinuxagent can't purge its + # user data + dpkg-divert --add --rename \ + --package walinuxagent-data-saver \ + --divert /usr/sbin/waagent.save /usr/sbin/waagent +fi + +#DEBHELPER# + +exit 0 |