dbus: catch new services without reboot (#20871)
DBus daemon now loads its config from /run/current-system/dbus. Reloading the daemon makes it re-read that file and catch the updates after a system upgrade.
This commit is contained in:
parent
da1cd49747
commit
29667f639c
|
@ -31,9 +31,6 @@ let
|
||||||
|
|
||||||
cp ${pkgs.dbus.out}/share/dbus-1/{system,session}.conf $out
|
cp ${pkgs.dbus.out}/share/dbus-1/{system,session}.conf $out
|
||||||
|
|
||||||
# avoid circular includes
|
|
||||||
sed -ri 's@(<include ignore_missing="yes">/etc/dbus-1/(system|session)\.conf</include>)@<!-- \1 -->@g' $out/{system,session}.conf
|
|
||||||
|
|
||||||
# include by full path
|
# include by full path
|
||||||
sed -ri "s@/etc/dbus-1/(system|session)-@$out/\1-@" $out/{system,session}.conf
|
sed -ri "s@/etc/dbus-1/(system|session)-@$out/\1-@" $out/{system,session}.conf
|
||||||
|
|
||||||
|
@ -98,11 +95,6 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ];
|
environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ];
|
||||||
|
|
||||||
environment.etc = singleton
|
|
||||||
{ source = configDir;
|
|
||||||
target = "dbus-1";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.extraUsers.messagebus = {
|
users.extraUsers.messagebus = {
|
||||||
uid = config.ids.uids.messagebus;
|
uid = config.ids.uids.messagebus;
|
||||||
description = "D-Bus system message bus daemon user";
|
description = "D-Bus system message bus daemon user";
|
||||||
|
@ -134,8 +126,8 @@ in
|
||||||
reloadIfChanged = true;
|
reloadIfChanged = true;
|
||||||
restartTriggers = [ configDir ];
|
restartTriggers = [ configDir ];
|
||||||
serviceConfig.ExecStart = [
|
serviceConfig.ExecStart = [
|
||||||
""
|
"" # Default dbus.service has two entries, we need to override both.
|
||||||
"${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=${configDir}/system.conf ${daemonArgs}"
|
"${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/system.conf ${daemonArgs}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -145,13 +137,17 @@ in
|
||||||
reloadIfChanged = true;
|
reloadIfChanged = true;
|
||||||
restartTriggers = [ configDir ];
|
restartTriggers = [ configDir ];
|
||||||
serviceConfig.ExecStart = [
|
serviceConfig.ExecStart = [
|
||||||
""
|
"" # Default dbus.service has two entries, we need to override both.
|
||||||
"${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=${configDir}/session.conf ${daemonArgs}"
|
"${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/session.conf ${daemonArgs}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
sockets.dbus.wantedBy = mkIf cfg.socketActivated [ "sockets.target" ];
|
sockets.dbus.wantedBy = mkIf cfg.socketActivated [ "sockets.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
|
environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
|
||||||
|
|
||||||
|
system.extraSystemBuilderCmds = ''
|
||||||
|
ln -s ${configDir} $out/dbus
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue