From bb236f99de9b2115c20b163c99b0056b4b5797e1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Jan 2010 18:03:31 +0000 Subject: [PATCH] * Urgh, socat ignores SIGCHLD, which causes Nix builds to fail. svn path=/nixos/trunk/; revision=19270 --- modules/testing/test-instrumentation.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index fb807060df39..4b1421979329 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -5,6 +5,19 @@ with pkgs.lib; +let + + # Urgh, `socat' sets the SIGCHLD to ignore. This wreaks havoc with + # some programs. + rootShell = pkgs.writeScript "shell.pl" + '' + #! ${pkgs.perl}/bin/perl + $SIG{CHLD} = 'DEFAULT'; + exec "/bin/sh"; + ''; + +in + { config = { @@ -20,12 +33,13 @@ with pkgs.lib; script = '' + export USER=root export HOME=/root export DISPLAY=:0.0 export GCOV_PREFIX=/tmp/coverage-data - source /etc/bashrc + source /etc/profile cd /tmp - exec ${pkgs.socat}/bin/socat tcp-listen:514,fork exec:/bin/sh 2> /dev/ttyS0 + exec ${pkgs.socat}/bin/socat tcp-listen:514,fork exec:${rootShell} 2> /dev/ttyS0 ''; };