nixos-container destroy: Remove gcroots

This commit is contained in:
Eelco Dolstra 2014-08-15 01:19:17 +02:00
parent e5a701eaa2
commit 883fa4f920

View File

@ -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;
}