From e97817b5770def5c24ac2ab56d7068e351f196ad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Mar 2012 16:08:03 +0000 Subject: [PATCH] * Atomically replace the /bin/sh symlink; otherwise there is a time window in which /bin/sh is missing. This can cause concurrently running programs to fail (e.g. Hydra jobs => http://hydra.nixos.org/build/2267831). You'd think the odds of this are very low, but they're not. svn path=/nixos/trunk/; revision=32901 --- modules/programs/bash/bash.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index 31a14663aa0..626ed722536 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -56,7 +56,8 @@ in # Create the required /bin/sh symlink; otherwise lots of things # (notably the system() function) won't work. mkdir -m 0755 -p /bin - ln -sfn ${config.system.build.binsh}/bin/sh /bin/sh + ln -sfn ${config.system.build.binsh}/bin/sh /bin/.sh.tmp + mv /bin/.sh.tmp /bin/sh # atomically replace /bin/sh ''; }