mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
Merge pull request #309068 from SuperSandro2000/dbus-broker
nixos/dbus: fix switching from dbus-broker to dbus
This commit is contained in:
commit
135fbd12c3
@ -147,6 +147,10 @@ in
|
||||
};
|
||||
|
||||
systemd.services.dbus = {
|
||||
aliases = [
|
||||
# hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
|
||||
"dbus-broker.service"
|
||||
];
|
||||
# Don't restart dbus-daemon. Bad things tend to happen if we do.
|
||||
reloadIfChanged = true;
|
||||
restartTriggers = [
|
||||
@ -158,6 +162,10 @@ in
|
||||
};
|
||||
|
||||
systemd.user.services.dbus = {
|
||||
aliases = [
|
||||
# hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
|
||||
"dbus-broker.service"
|
||||
];
|
||||
# Don't restart dbus-daemon. Bad things tend to happen if we do.
|
||||
reloadIfChanged = true;
|
||||
restartTriggers = [
|
||||
@ -184,6 +192,8 @@ in
|
||||
# https://github.com/NixOS/nixpkgs/issues/108643
|
||||
systemd.services.dbus-broker = {
|
||||
aliases = [
|
||||
# allow other services to just depend on dbus,
|
||||
# but also a hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
|
||||
"dbus.service"
|
||||
];
|
||||
unitConfig = {
|
||||
@ -203,6 +213,8 @@ in
|
||||
|
||||
systemd.user.services.dbus-broker = {
|
||||
aliases = [
|
||||
# allow other services to just depend on dbus,
|
||||
# but also a hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
|
||||
"dbus.service"
|
||||
];
|
||||
# Don't restart dbus. Bad things tend to happen if we do.
|
||||
|
@ -472,6 +472,9 @@ sub handle_modified_unit { ## no critic(Subroutines::ProhibitManyArgs, Subroutin
|
||||
$units_to_reload->{$unit} = 1;
|
||||
record_unit($reload_list_file, $unit);
|
||||
}
|
||||
elsif ($unit eq "dbus.service" || $unit eq "dbus-broker.service") {
|
||||
# dbus service should only ever be reloaded, not started/stoped/restarted as that would break the system.
|
||||
}
|
||||
elsif (!parse_systemd_bool(\%new_unit_info, "Service", "X-RestartIfChanged", 1) || parse_systemd_bool(\%new_unit_info, "Unit", "RefuseManualStop", 0) || parse_systemd_bool(\%new_unit_info, "Unit", "X-OnlyManualStart", 0)) {
|
||||
$units_to_skip->{$unit} = 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user