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 Jun 3, 2024
1 parent c6fad6a commit 743635a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,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

0 comments on commit 743635a

Please sign in to comment.