New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/dbus-unit: disable service activation while dbus-broker.service … #27570
Conversation
…is deactivating fix: #26799
@@ -1858,6 +1859,14 @@ int bus_unit_queue_job( | |||
(type == JOB_RELOAD_OR_START && job_type_collapse(type, u) == JOB_START && u->refuse_manual_start)) | |||
return sd_bus_error_setf(error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, unit %s may be requested by dependency only (it is configured to refuse manual start/stop).", u->id); | |||
|
|||
if (u->manager && type == JOB_START && u->type == UNIT_SERVICE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition u->manager
is mostly redundant. If you want, then please add assert(u->manager);
at the beginning of the function.
Manager *m = u->manager; | ||
Service *s = SERVICE(u); | ||
if (manager_unit_deactivating_or_pending(m, SPECIAL_DBUS_BROKER_SERVICE) && | ||
s != NULL && s->type == SERVICE_DBUS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s != NULL
is mostly redundant. If you want to check that, please use ASSERT_PTR()
.
assert(u->manager);
...
if (type == JOB_START && u->type == UNIT_SERVICE &&
ASSERT_PTR(SERVICE(u))->type == SERVICE_DBUS &&
manager_unit_deactivating_or_pending(u->manager, SPECIAL_DBUS_BROKER_SERVICE))
return sd_bus_error_set(...);
if (u->manager && type == JOB_START && u->type == UNIT_SERVICE) { | ||
Manager *m = u->manager; | ||
Service *s = SERVICE(u); | ||
if (manager_unit_deactivating_or_pending(m, SPECIAL_DBUS_BROKER_SERVICE) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why dbus-broker.service is checked instead of dbus.service? Even if dbus-broker.service is used, IIRC, we assume dbus.service is an alias of dbus-broker.service.
Also, in signal_activation_request()
, we checked with manager_unit_inactive_or_pending()
. Why not to also use that here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to export and use manager_dbus_is_running
?
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces systemd#27570 Closes systemd#26799
superseded by #27579 |
…is deactivating
fix: #26799