Systems based on systemd mount the root shared by default. We don't want
mounts done during creation by templates nor those done internally by
bdev during rsync based clones to propagate to the root mntns.
The create case already had the right check, but the mount call was
missing "/", so it was failing.
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
SYSERROR("unshare CLONE_NEWNS");
return -1;
}
+ if (detect_shared_rootfs()) {
+ if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) {
+ SYSERROR("Failed to make / rslave to run rsync");
+ ERROR("Continuing...");
+ }
+ }
// If not a snapshot, copy the fs.
if (orig->ops->mount(orig) < 0) {
exit(1);
}
if (detect_shared_rootfs()) {
- if (mount("", "", NULL, MS_SLAVE|MS_REC, 0)) {
+ if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) {
SYSERROR("Failed to make / rslave to run template");
ERROR("Continuing...");
}