From 9bf8801dc6cfba63811f16b2b9cf0b37ad5897d5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 7 Nov 2009 15:29:46 +0000 Subject: [PATCH] * Use a tmpfs for /var/run/nscd 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 holding some mmap mappings to deleted files in /var/run/nscd. E.g. lsof shows: init 1 root DEL REG 253,0 1850313 /var/run/nscd/dbyn3Piz init 1 root DEL REG 253,0 1850312 /var/run/nscd/dbt2e8PH See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324900. This is a workaround - it would be better if Upstart didn't do this. svn path=/nixos/branches/upstart-0.6/; revision=18258 --- modules/system/activation/activation-script.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index a62120363f2..c29c82dd7ae 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -84,6 +84,14 @@ let mkdir -m 0755 -p /var/run/nix/current-load # for distributed builds mkdir -m 0700 -p /var/run/nix/remote-stores + # Use a tmpfs for /var/run/nscd 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 holding some mmap mapping to deleted files in + # /var/run/nscd.) + mkdir -p /var/run/nscd + ${pkgs.utillinux}/bin/mount -t tmpfs -o "mode=755" none /var/run/nscd + mkdir -m 0755 -p /var/log touch /var/log/wtmp # must exist