summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-04 00:01:08 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-04 00:01:08 -0500
commit964aeaa9c1eac3fafa73ef9abf344613a093cb06 (patch)
tree62b2d2daf19445ab32363bb6fbe990cd098d9a1f
parentd02a257063db96f487510b9841a9a396ef2675af (diff)
downloadvyos-cloud-init-964aeaa9c1eac3fafa73ef9abf344613a093cb06.tar.gz
vyos-cloud-init-964aeaa9c1eac3fafa73ef9abf344613a093cb06.zip
postinst/preinst: cleanup old multi-user.target enabled files
also, actually enable the services. now this will have them enabled in the cloud-init.target.
-rw-r--r--packages/debian/cloud-init.postinst17
-rw-r--r--packages/debian/cloud-init.preinst22
-rwxr-xr-xpackages/debian/rules.in3
3 files changed, 39 insertions, 3 deletions
diff --git a/packages/debian/cloud-init.postinst b/packages/debian/cloud-init.postinst
new file mode 100644
index 00000000..f1222b42
--- /dev/null
+++ b/packages/debian/cloud-init.postinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -x
+cleanup_lp1552999() {
+ local oldver="$1" last_bad_ver="0.7.7~bzr1178"
+ dpkg --compare-versions "$oldver" le "$last_bad_ver" || return 0
+ local edir="/etc/systemd/system/multi-user.target.wants"
+ rm -f "$edir/cloud-config.service" "$edir/cloud-final.service" \
+ "$edir/cloud-init-local.service" "$edir/cloud-init.service"
+}
+
+
+#DEBHELPER#
+
+if [ "$1" = "configure" ]; then
+ oldver="$2"
+ cleanup_lp1552999 "$oldver"
+fi
diff --git a/packages/debian/cloud-init.preinst b/packages/debian/cloud-init.preinst
new file mode 100644
index 00000000..babaab6c
--- /dev/null
+++ b/packages/debian/cloud-init.preinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+# vi: ts=4 expandtab
+
+set -x
+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"
+}
+
+
+if [ "$1" = "upgrade" ]; then
+ oldver="$2"
+ cleanup_lp1552999 "$oldver"
+fi
+set +x
+
+#DEBHELPER#
diff --git a/packages/debian/rules.in b/packages/debian/rules.in
index 16f9b817..a24720f4 100755
--- a/packages/debian/rules.in
+++ b/packages/debian/rules.in
@@ -17,8 +17,5 @@ override_dh_auto_test:
http_proxy= make check
endif
-override_dh_systemd_enable:
- dh_systemd_enable --no-enable
-
override_dh_systemd_start:
dh_systemd_start --no-restart-on-upgrade --no-start