* Upstart job for HAL.

svn path=/nixos/trunk/; revision=8854
This commit is contained in:
Eelco Dolstra 2007-06-09 20:05:04 +00:00
parent 02514fc802
commit 258ef4bf19
4 changed files with 62 additions and 2 deletions

View File

@ -802,6 +802,15 @@
}
{
name = ["services" "hal" "enable"];
default = true;
description = "
Whether to start the HAL daemon.
";
}
{
name = ["installer" "nixpkgsURL"];
default = "";

View File

@ -1,4 +1,4 @@
{stdenv, dbus}:
{stdenv, dbus, dbusServices ? []}:
let
@ -10,9 +10,13 @@ let
name = "dbus-conf";
buildCommand = "
ensureDir $out
ensureDir $out/system.d
substitute ${dbus}/etc/dbus-1/system.conf $out/system.conf \\
--replace '<fork/>' ''
ensureDir $out/system.d
for i in ${toString dbusServices}; do
ln -s $i/etc/dbus-1/system.d/* $out/system.d/
done
";
};
@ -29,6 +33,8 @@ in
}
];
extraPath = [dbus];
job = "
description \"D-Bus system message bus daemon\"

View File

@ -186,6 +186,14 @@ import ../upstart-jobs/gather.nix {
++ optional ["services" "dbus" "enable"]
(import ../upstart-jobs/dbus.nix {
inherit (pkgs) stdenv dbus;
dbusServices =
pkgs.lib.optional (config.get ["services" "hal" "enable"]) pkgs.hal;
})
# HAL daemon.
++ optional ["services" "hal" "enable"]
(import ../upstart-jobs/hal.nix {
inherit (pkgs) stdenv hal;
})
# Handles the reboot/halt events.

37
upstart-jobs/hal.nix Normal file
View File

@ -0,0 +1,37 @@
{stdenv, hal}:
let
homeDir = "/var/run/dbus";
in
{
name = "hal";
users = [
{ name = "haldaemon";
uid = (import ../system/ids.nix).uids.haldaemon;
description = "HAL daemon user";
# home = homeDir;
}
];
extraPath = [hal];
job = "
description \"HAL daemon\"
start on dbus
stop on shutdown
start script
mkdir -m 0755 -p /var/cache/hald
end script
respawn ${hal}/sbin/hald --daemon=no --verbose=yes
";
}