From 93571df6808c794749d83dcaee1ea84478704c1d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 9 Sep 2009 21:22:00 +0000 Subject: [PATCH] * Make sure that hal is really running when the X server starts, otherwise we could end up without any input devices. svn path=/nixos/trunk/; revision=16998 --- modules/services/hardware/hal.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/services/hardware/hal.nix b/modules/services/hardware/hal.nix index b8d858faa92..5e448d13d90 100644 --- a/modules/services/hardware/hal.nix +++ b/modules/services/hardware/hal.nix @@ -84,11 +84,21 @@ in preStart = '' mkdir -m 0755 -p /var/cache/hald + mkdir -m 0755 -p /var/run/hald rm -f /var/cache/hald/fdi-cache + + # !!! Hack: start the daemon here to make sure it's + # running when the Upstart job reaches the "running" + # state. Should be fixable in Upstart 0.6. + ${hal}/sbin/hald ''; - exec = "${hal}/sbin/hald --daemon=no"; + postStop = + '' + pid=$(cat /var/run/hald/pid) + test -n "$pid" && kill "$pid" + ''; }; services.udev.packages = [hal];