From f067d179abb73fdf4153e25c7f64380a68ae7777 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Aug 2010 11:59:04 +0000 Subject: [PATCH] * Create /nix/var/nix/gcroots/tmp in the activation script. The build hook uses this directory to store temporary GC roots. (It creates it if it doesn't exist, but it's better to do it here as well to ensure the right ownership and permissions.) * Clear /nix/var/nix/gcroots/tmp and /nix/var/nix/temproots at boot time. svn path=/nixos/trunk/; revision=23417 --- modules/system/activation/activation-script.nix | 1 + modules/system/boot/stage-2-init.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index 5c6ca55add82..8924041ae600 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -133,6 +133,7 @@ let /nix/var/nix/chroots mkdir -m 1777 -p /nix/var/nix/gcroots/per-user mkdir -m 1777 -p /nix/var/nix/profiles/per-user + mkdir -m 1777 -p /nix/var/nix/gcroots/tmp ln -sf /nix/var/nix/profiles /nix/var/nix/gcroots/ ln -sf /nix/var/nix/manifests /nix/var/nix/gcroots/ diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index 8859e5716ffb..834ad9548ed3 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -130,6 +130,10 @@ mkdir -m 1777 /tmp/.ICE-unix rm -rf /nix/var/nix/chroots # recreated in activate-configuration.sh +# Also get rid of temporary GC roots. +rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots + + # Use a tmpfs for /var/run to ensure that / or /var can be unmounted # or at least remounted read-only during shutdown. (Upstart 0.6 # apparently uses nscd to do some name lookups, resulting in it