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 = ''