* Upstart job for HAL.
svn path=/nixos/trunk/; revision=8854
This commit is contained in:
parent
02514fc802
commit
258ef4bf19
@ -802,6 +802,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
name = ["services" "hal" "enable"];
|
||||||
|
default = true;
|
||||||
|
description = "
|
||||||
|
Whether to start the HAL daemon.
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name = ["installer" "nixpkgsURL"];
|
name = ["installer" "nixpkgsURL"];
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{stdenv, dbus}:
|
{stdenv, dbus, dbusServices ? []}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -10,9 +10,13 @@ let
|
|||||||
name = "dbus-conf";
|
name = "dbus-conf";
|
||||||
buildCommand = "
|
buildCommand = "
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
ensureDir $out/system.d
|
|
||||||
substitute ${dbus}/etc/dbus-1/system.conf $out/system.conf \\
|
substitute ${dbus}/etc/dbus-1/system.conf $out/system.conf \\
|
||||||
--replace '<fork/>' ''
|
--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 = "
|
job = "
|
||||||
description \"D-Bus system message bus daemon\"
|
description \"D-Bus system message bus daemon\"
|
||||||
|
|
||||||
|
@ -186,6 +186,14 @@ import ../upstart-jobs/gather.nix {
|
|||||||
++ optional ["services" "dbus" "enable"]
|
++ optional ["services" "dbus" "enable"]
|
||||||
(import ../upstart-jobs/dbus.nix {
|
(import ../upstart-jobs/dbus.nix {
|
||||||
inherit (pkgs) stdenv dbus;
|
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.
|
# Handles the reboot/halt events.
|
||||||
|
37
upstart-jobs/hal.nix
Normal file
37
upstart-jobs/hal.nix
Normal 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
|
||||||
|
";
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user