nixos-container destroy: Remove gcroots
This commit is contained in:
parent
e5a701eaa2
commit
883fa4f920
@ -152,6 +152,7 @@ if ($action eq "create") {
|
||||
|
||||
my $root = "/var/lib/containers/$containerName";
|
||||
my $profileDir = "/nix/var/nix/profiles/per-container/$containerName";
|
||||
my $gcRootsDir = "/nix/var/nix/gcroots/per-container/$containerName";
|
||||
my $confFile = "/etc/containers/$containerName.conf";
|
||||
die "$0: container ‘$containerName’ does not exist\n" if !-e $confFile;
|
||||
|
||||
@ -172,6 +173,7 @@ if ($action eq "destroy") {
|
||||
stopContainer if isContainerRunning;
|
||||
|
||||
rmtree($profileDir) if -e $profileDir;
|
||||
rmtree($gcRootsDir) if -e $gcRootsDir;
|
||||
rmtree($root) if -e $root;
|
||||
unlink($confFile) or die;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user