[lxc-devel] [lxcfs/master] hook: don't use mountpoint

stgraber on Github lxc-bot at linuxcontainers.org
Sun Mar 20 15:02:11 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 513 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160320/1b1bf9f0/attachment.bin>
-------------- next part --------------
From adc7f0db5247f36b2287cd56d1af690d59806337 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 20 Mar 2016 11:00:55 -0400
Subject: [PATCH] hook: don't use mountpoint
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It's not very reliable (had it fail on one of my servers) and since
we're already iterating through a list of mountpoints, it's also
completely unneeded.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 share/lxc.mount.hook.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/lxc.mount.hook.in b/share/lxc.mount.hook.in
index 89e06b0..9a246a5 100755
--- a/share/lxc.mount.hook.in
+++ b/share/lxc.mount.hook.in
@@ -42,7 +42,7 @@ if [ -d "${LXC_ROOTFS_MOUNT}/sys/fs/cgroup" ]; then
 
             while grep "${LXC_ROOTFS_MOUNT}/sys/fs/cgroup/${DEST}" /proc/self/mountinfo; do
                 grep "${LXC_ROOTFS_MOUNT}/sys/fs/cgroup/${DEST}" /proc/self/mountinfo | cut -d' ' -f5 | while read line; do
-                     mountpoint -q ${line} && umount -l ${line} || true
+                     umount -l ${line} || true
                 done
             done
 


More information about the lxc-devel mailing list