Skip to content

Commit b9e762d

Browse files
committed
Make sure the new runtime dir exists before mounting.
This seems to be required under some choices of runtime dir. Also clean up some redundant logging. Signed-off-by: Sebastien Dabdoub <[email protected]>
1 parent ebe86a1 commit b9e762d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bindings.c

+5
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,11 @@ static int permute_prepare(void)
762762
return -1;
763763
}
764764

765+
if (!mkdir_p(new_runtime, 0755)) {
766+
lxcfs_error("Failed to create dir %s\n", new_runtime);
767+
return -1;
768+
}
769+
765770
if (mount(runtime_path, new_runtime, NULL, MS_BIND, 0) < 0) {
766771
lxcfs_error("Failed to bind-mount %s into new root: %s.\n", runtime_path, strerror(errno));
767772
return -1;

0 commit comments

Comments
 (0)