about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-15 01:19:17 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-15 02:14:27 +0200
commit883fa4f9205b2aa699760a73e1f1a26bb4f5296e (patch)
treea7545c152c3d5fbcf453e3cd1ffea102b36b0677 /nixos
parente5a701eaa24e04d7f21623f1eb347a78270edbba (diff)
downloadnixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar.gz
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar.bz2
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar.lz
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar.xz
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.tar.zst
nixlib-883fa4f9205b2aa699760a73e1f1a26bb4f5296e.zip
nixos-container destroy: Remove gcroots
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/nixos-container.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/nixos-container.pl b/nixos/modules/virtualisation/nixos-container.pl
index 5083abd84489..c0d30346e568 100644
--- a/nixos/modules/virtualisation/nixos-container.pl
+++ b/nixos/modules/virtualisation/nixos-container.pl
@@ -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;
 }