summaryrefslogtreecommitdiff
path: root/debian/cloud-init.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/cloud-init.preinst')
-rw-r--r--debian/cloud-init.preinst15
1 files changed, 14 insertions, 1 deletions
diff --git a/debian/cloud-init.preinst b/debian/cloud-init.preinst
index e383c092..c8406e31 100644
--- a/debian/cloud-init.preinst
+++ b/debian/cloud-init.preinst
@@ -1,7 +1,6 @@
#!/bin/sh
set -e
-#DEBHELPER#
# Remove a no-longer used conffile
rm_conffile() {
local PKGNAME="$1"
@@ -172,6 +171,16 @@ EOM
fi
}
+cleanup_lp1552999() {
+ local oldver="$1" last_bad_ver="0.7.7~bzr1178"
+ dpkg --compare-versions "$oldver" le "$last_bad_ver" || return 0
+ local hdir="/var/lib/systemd/deb-systemd-helper-enabled"
+ hdir="$hdir/multi-user.target.wants"
+ local edir="/etc/systemd/system/multi-user.target.wants"
+ rm -f "$hdir/cloud-config.service" "$hdir/cloud-final.service" \
+ "$hdir/cloud-init-local.service" "$hdir/cloud-init.service"
+}
+
case "$1" in
install|upgrade)
# removing obsolete conffiles from the 'ec2-init' package
@@ -238,4 +247,8 @@ case "$1" in
[ -d "${d}/cloud.cfg.d" ] || mkdir "${d}/cloud.cfg.d"
mv "$d/distro.cfg" "$d/cloud.cfg.d/90_dpkg.cfg"
fi
+
+ cleanup_lp1552999 "$oldver"
esac
+
+#DEBHELPER#