mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 17:53:37 +00:00
* Added a job to start the D-Bus system-wide message bus daemon.
svn path=/nixos/trunk/; revision=8848
This commit is contained in:
parent
29c5178bdf
commit
f70df0b275
@ -792,6 +792,16 @@
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name = ["services" "dbus" "enable"];
|
||||
default = true;
|
||||
description = "
|
||||
Whether to start the D-Bus message bus daemon. It is required
|
||||
by the HAL service.
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name = ["installer" "nixpkgsURL"];
|
||||
default = "";
|
||||
|
56
upstart-jobs/dbus.nix
Normal file
56
upstart-jobs/dbus.nix
Normal file
@ -0,0 +1,56 @@
|
||||
{stdenv, dbus}:
|
||||
|
||||
let
|
||||
|
||||
homeDir = "/var/run/dbus";
|
||||
|
||||
# Take the standard system configuration file, except that we don't
|
||||
# want to fork (Upstart will monitor the daemon).
|
||||
configFile = stdenv.mkDerivation {
|
||||
name = "dbus-conf";
|
||||
buildCommand = "
|
||||
ensureDir $out
|
||||
ensureDir $out/system.d
|
||||
substitute ${dbus}/etc/dbus-1/system.conf $out/system.conf \\
|
||||
--replace '<fork/>' ''
|
||||
";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
name = "dbus";
|
||||
|
||||
users = [
|
||||
{ name = "messagebus";
|
||||
uid = (import ../system/ids.nix).uids.messagebus;
|
||||
description = "D-Bus system message bus daemon user";
|
||||
home = homeDir;
|
||||
}
|
||||
];
|
||||
|
||||
job = "
|
||||
description \"D-Bus system message bus daemon\"
|
||||
|
||||
start on startup
|
||||
stop on shutdown
|
||||
|
||||
start script
|
||||
|
||||
mkdir -m 0755 -p ${homeDir}
|
||||
chown messagebus ${homeDir}
|
||||
|
||||
mkdir -m 0755 -p /var/lib/dbus
|
||||
${dbus}/bin/dbus-uuidgen --ensure
|
||||
|
||||
end script
|
||||
|
||||
respawn
|
||||
|
||||
script
|
||||
rm -f ${homeDir}/pid
|
||||
exec ${dbus}/bin/dbus-daemon --config-file=${configFile}/system.conf
|
||||
end script
|
||||
";
|
||||
|
||||
}
|
@ -182,6 +182,12 @@ import ../upstart-jobs/gather.nix {
|
||||
inherit (pkgs) alsaUtils;
|
||||
})
|
||||
|
||||
# D-Bus system-wide daemon.
|
||||
++ optional ["services" "dbus" "enable"]
|
||||
(import ../upstart-jobs/dbus.nix {
|
||||
inherit (pkgs) stdenv dbus;
|
||||
})
|
||||
|
||||
# Handles the reboot/halt events.
|
||||
++ (map
|
||||
(event: makeJob (import ../upstart-jobs/halt.nix {
|
||||
|
Loading…
Reference in New Issue
Block a user