Skip to content

Commit

Permalink
Make sure the new runtime dir exists before mounting.
Browse files Browse the repository at this point in the history
This seems to be required under some choices of runtime dir. Also clean up some redundant logging.

Signed-off-by: Sebastien Dabdoub <[email protected]>
  • Loading branch information
sdab committed Feb 21, 2024
1 parent 757df89 commit 2c444bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,11 @@ static int permute_prepare(void)
return -1;
}

if (!mkdir_p(new_runtime, 0755)) {
lxcfs_error("Failed to create dir %s\n", new_runtime);
return -1;
}

if (mount(runtime_path, new_runtime, NULL, MS_BIND, 0) < 0) {
lxcfs_error("Failed to bind-mount %s into new root: %s.\n", runtime_path, strerror(errno));
return -1;
Expand Down
1 change: 0 additions & 1 deletion src/lxcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ static bool do_set_runtime_path(const char *path)
return false;
}

lxcfs_info("set runtime path %s", path);
return __set_runtime_path(path);
}

Expand Down

0 comments on commit 2c444bc

Please sign in to comment.