fixing lock issue
This commit is contained in:
1 parent
22fd8fbce8
commit
7f58254dbc
1 file changed
+5
-2
@@ -162,8 +162,11 @@ func (l *Local) Start(ctx context.Context, spec node.StartSpec) error {
|
|||||||
if err := os.RemoveAll(root); err != nil {
|
if err := os.RemoveAll(root); err != nil {
|
||||||
return fmt.Errorf("clearing old container files: %w", err)
|
return fmt.Errorf("clearing old container files: %w", err)
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(filepath.Join(root, "etc"), 0o755); err != nil {
|
// systemd-nspawn refuses a directory without /usr as not an OS tree.
|
||||||
return err
|
for _, dir := range []string{"etc", "usr"} {
|
||||||
|
if err := os.MkdirAll(filepath.Join(root, dir), 0o755); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if f, err := os.OpenFile(filepath.Join(root, "etc/os-release"), os.O_CREATE, 0o644); err == nil {
|
if f, err := os.OpenFile(filepath.Join(root, "etc/os-release"), os.O_CREATE, 0o644); err == nil {
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|||||||
Reference in new issue
Block a user