fixing clean up bug
This commit is contained in:
1 parent
563dd7a759
commit
d7f5dba677
2 files changed
+3
-1
No files matched your search
@@ -159,6 +159,8 @@ func (l *Local) Start(ctx context.Context, spec node.StartSpec) error {
|
||||
|
||||
// Only the home folder persists. NixOS rebuilds the rest on boot.
|
||||
root := filepath.Join(l.cfg.MachinesDir, spec.Machine)
|
||||
// NixOS marks /var/empty immutable, which blocks RemoveAll.
|
||||
_ = exec.Command("chattr", "-i", filepath.Join(root, "var/empty")).Run()
|
||||
if err := os.RemoveAll(root); err != nil {
|
||||
return fmt.Errorf("clearing old container files: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user