Hi Tollef,

attached is a proposed patch for 11-2

Please consider also my other patches from
http://debs.michaelbiebl.de/systemd-patches/

Cheers,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From ecfc5a6db7e184f23a7852ed008c52455d9553e4 Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Sun, 17 Oct 2010 01:03:58 +0200
Subject: [PATCH 5/5] Properly cleanup /cgroup on upgrades

---
 debian/systemd.postinst |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/debian/systemd.postinst b/debian/systemd.postinst
index fe4ab8d..827b72f 100644
--- a/debian/systemd.postinst
+++ b/debian/systemd.postinst
@@ -4,9 +4,18 @@ set -e
 
 if [ -n "$2" ]; then
     systemctl daemon-reexec || true
-    if [ -d /cgroup ]; then
-	rmdir --ignore-fail-on-non-empty /cgroup
+
+    if dpkg --compare-versions "$2" lt "11-2"; then
+        if [ -e /proc/mounts ]; then
+            mounts=$(awk '/ \/cgroup/ {print $2}' < /proc/mounts | sort -r)
+            for m in $mounts; do
+                umount "$m" || true;
+            done
+        fi
+        if [ -d /cgroup ]; then
+            rmdir --ignore-fail-on-non-empty /cgroup
+        fi
     fi
 fi
 
-#DEBHELPER#
+
-- 
1.7.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to