3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/upstart-jobs/hal.nix
Eelco Dolstra 049c60e8c0 * Quick hack to make sure that acpid starts before hal.
svn path=/nixos/trunk/; revision=14139
2009-02-20 15:11:07 +00:00

42 lines
770 B
Nix

{stdenv, hal, config}:
{
name = "hal";
users = [
{ name = "haldaemon";
uid = (import ../system/ids.nix).uids.haldaemon;
description = "HAL daemon user";
}
];
groups = [
{ name = "haldaemon";
gid = (import ../system/ids.nix).gids.haldaemon;
}
];
extraPath = [hal];
job = ''
description "HAL daemon"
# !!! TODO: make sure that HAL starts after acpid,
# otherwise hald-addon-acpi will grab /proc/acpi/event.
start on ${if config.powerManagement.enable then "acpid" else "dbus"}
stop on shutdown
start script
# !!! quick hack: wait until dbus has started
sleep 3
mkdir -m 0755 -p /var/cache/hald
end script
respawn ${hal}/sbin/hald --daemon=no
'';
}