Control: tags -1 +patch On 2014-08-14, Vagrant Cascadian wrote: > A quick workaround is to use "mount --bind" instead of "mount --move", > but this has the undesired side-effect of leaving two mounts in place, > one in /tmp/.USERNAME-ltspfs/MOUNT and one in /media/USERNAME/MOUNT. > Though some brief experiments show that unmounting the /tmp mount left > the /media mount in place when i tried it... that might make it a viable > workaround.
Patch that implements this, including the umounting:
diff --git a/scripts/ltspfsmounter b/scripts/ltspfsmounter
index 642202f..5322b23 100644
--- a/scripts/ltspfsmounter
+++ b/scripts/ltspfsmounter
@@ -32,6 +32,7 @@ def add_ltspfsmount(conn, path, root, dev, mediaroot):
hidden_mount = '%s/%s' % (root, dev)
lbmount_command = ['lbmount', dev]
ltspfs_mount = ['ltspfs', conn+':'+path, root+'/'+dev]
+ ltspfs_umount=['fusermount', '-uzq', hidden_mount]
if not os.access(root, 0):
os.mkdir(root)
@@ -47,6 +48,7 @@ def add_ltspfsmount(conn, path, root, dev, mediaroot):
try:
call(lbmount_command)
if os.access(hidden_mount, 0):
+ call(ltspfs_umount)
os.rmdir(hidden_mount)
if os.access(root, 0):
os.rmdir(root)
diff --git a/src/lbmount.c b/src/lbmount.c
index 8421e25..c1a8067 100644
--- a/src/lbmount.c
+++ b/src/lbmount.c
@@ -155,7 +155,7 @@ int root_mounter(const char *path1, const char *path2)
}
/* Statically build command line to prevent monkey business */
if (path2)
- execle(mountprog, mountprog, "--move", path1, path2, NULL,
+ execle(mountprog, mountprog, "--bind", path1, path2, NULL,
null_env);
else
execle(umountprog, umountprog, "-l", path1, NULL, null_env);
live well,
vagrant
pgpEWEzWxml1_.pgp
Description: PGP signature

