X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmount-setup.c;h=be11bb8f369a1a18741ad0adaf281cd3c42d9f02;hp=c10c6dad1c853f5c4fe3f4310a01de2ebfd7be30;hb=8f0e73f250f4a397ea07d29a339bd7e64d077612;hpb=1421211924ff05af3b0c0d52f1c84472d0307456;ds=sidebyside diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index c10c6dad1..be11bb8f3 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -398,7 +398,16 @@ int mount_setup(bool loaded_policy) { /* Create a few default symlinks, which are normally created * by udevd, but some scripts might need them before we start * udevd. */ - dev_setup(); + dev_setup(""); + + /* Mark the root directory as shared in regards to mount + * propagation. The kernel defaults to "private", but we think + * it makes more sense to have a default of "shared" so that + * nspawn and the container tools work out of the box. If + * specific setups need other settings they can reset the + * propagation mode to private if needed. */ + if (mount(NULL, "/", NULL, MS_REC|MS_SHARED, NULL) < 0) + log_warning("Failed to set up the root directory for shared mount propagation: %m"); /* Create a few directories we always want around */ mkdir_label("/run/systemd", 0755);