diff -Nru cgroup-lite-1.1.2/debian/cgroup-lite.upstart cgroup-lite-1.1.4/debian/cgroup-lite.upstart --- cgroup-lite-1.1.2/debian/cgroup-lite.upstart 2012-06-20 17:50:56.000000000 +0000 +++ cgroup-lite-1.1.4/debian/cgroup-lite.upstart 2013-12-04 17:54:17.000000000 +0000 @@ -6,7 +6,7 @@ pre-start script test -x /bin/cgroups-mount || { stop; exit 0; } test -d /sys/fs/cgroup || { stop; exit 0; } - /bin/cgroups-mount + /bin/cgroups-mount || {stop; exit 0; } end script post-stop script diff -Nru cgroup-lite-1.1.2/debian/changelog cgroup-lite-1.1.4/debian/changelog --- cgroup-lite-1.1.2/debian/changelog 2012-07-05 17:00:00.000000000 +0000 +++ cgroup-lite-1.1.4/debian/changelog 2013-12-18 18:05:54.000000000 +0000 @@ -1,3 +1,18 @@ +cgroup-lite (1.1.4) precise-proposed; urgency=medium + + * debian/cgroup-lite.upstart: undo 1.1.3 changes + * scripts/*: pull in changes from trusty to make the scripts more + robust to previous mounts and/or mount failures. + + -- Serge Hallyn Wed, 18 Dec 2013 11:48:47 -0600 + +cgroup-lite (1.1.3) precise-proposed; urgency=low + + * debian/cgroup-lite.upstart: stop and exit 0 if mount-cgroups failed. + (LP: #1257857) + + -- Serge Hallyn Wed, 04 Dec 2013 11:54:34 -0600 + cgroup-lite (1.1.2) precise-proposed; urgency=low * Complete the fix for separate /usr (LP: #989354) diff -Nru cgroup-lite-1.1.2/scripts/cgroups-mount cgroup-lite-1.1.4/scripts/cgroups-mount --- cgroup-lite-1.1.2/scripts/cgroups-mount 2012-07-05 16:59:46.000000000 +0000 +++ cgroup-lite-1.1.4/scripts/cgroups-mount 2013-12-18 17:47:28.000000000 +0000 @@ -29,12 +29,13 @@ exit 0 fi -mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup +# Mount /sys/fs/cgroup if not already done +mountpoint -q /sys/fs/cgroup || mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup # get list of cgroup controllers for d in `sed -e '1d;s/\([^\t]\)\t.*$/\1/' /proc/cgroups`; do - mkdir /sys/fs/cgroup/$d - mount -n -t cgroup -o $d cgroup /sys/fs/cgroup/$d + mkdir -p /sys/fs/cgroup/$d + mountpoint -q /sys/fs/cgroup/$d || (mount -n -t cgroup -o $d cgroup /sys/fs/cgroup/$d || rmdir /sys/fs/cgroup/$d || true) done exit 0 diff -Nru cgroup-lite-1.1.2/scripts/cgroups-umount cgroup-lite-1.1.4/scripts/cgroups-umount --- cgroup-lite-1.1.2/scripts/cgroups-umount 2012-07-05 17:09:50.000000000 +0000 +++ cgroup-lite-1.1.4/scripts/cgroups-umount 2013-12-18 17:48:32.000000000 +0000 @@ -12,14 +12,12 @@ exit 0 fi -# Don't try to get too smart, just optimistically try to umount all -# that we think we mounted -if [ ! -d /sys/fs/cgroup ]; then - exit 0 -fi +mountpoint -q /sys/fs/cgroup || exit 0 + cd /sys/fs/cgroup for d in `sed -e '1d;s/\([^\t]\)\t.*$/\1/' /proc/cgroups`; do - [ -d $d ] && umount $d || true + mountpoint -q $d && umount $d + [ -d $d ] && rmdir $d done cd ..