From 5d240b99d57126ee611f46fb7cd5ea2f15166dba Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Nov 2009 11:31:57 +0000 Subject: [PATCH] * Work around a bug in HAL (it fails to start if $PATH is too long, since it uses a 512-byte buffer somewhere). svn path=/nixos/branches/upstart-0.6/; revision=18198 --- modules/services/hardware/hal.nix | 12 +++++------- modules/services/system/dbus.nix | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/services/hardware/hal.nix b/modules/services/hardware/hal.nix index 11cda8d4cc4b..56bcf1fb4d8f 100644 --- a/modules/services/hardware/hal.nix +++ b/modules/services/hardware/hal.nix @@ -69,7 +69,7 @@ in # !!! TODO: make sure that HAL starts after acpid, # otherwise hald-addon-acpi will grab /proc/acpi/event. - startOn = if config.powerManagement.enable then "acpid" else "dbus"; + startOn = if config.powerManagement.enable then "started acpid" else "started dbus"; stopOn = "shutdown"; environment = @@ -100,15 +100,13 @@ in rm -f /var/cache/hald/fdi-cache - # For some weird reason HAL sometimes fails to start at - # boot time, which seems to be timing-dependent. As a - # temporary workaround, sleep for a while here. - sleep 2 - # !!! 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 --use-syslog # --verbose=yes + # The `PATH=' works around a bug in HAL: it concatenates + # its libexec directory to $PATH, but using a 512-byte + # buffer. So if $PATH is too long it fails. + PATH= ${hal}/sbin/hald --use-syslog # --verbose=yes ''; postStop = diff --git a/modules/services/system/dbus.nix b/modules/services/system/dbus.nix index 8e1d9bd4d10b..d91be4eb88b3 100644 --- a/modules/services/system/dbus.nix +++ b/modules/services/system/dbus.nix @@ -113,8 +113,7 @@ in }; jobs.dbus = - { startOn = "udev"; - stopOn = "shutdown"; + { startOn = "started udev"; preStart = ''