-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
#include "path-util.h" | ||
#include "process-util.h" | ||
#include "selinux-access.h" | ||
#include "service.h" | ||
#include "signal-util.h" | ||
#include "special.h" | ||
#include "string-table.h" | ||
|
@@ -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) { | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to export and use |
||
s != NULL && s->type == SERVICE_DBUS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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(...); |
||
return sd_bus_error_set(error, BUS_ERROR_SHUTTING_DOWN, "Refusing activation, D-Bus is shutting down."); | ||
} | ||
|
||
r = sd_bus_message_new_method_return(message, &reply); | ||
if (r < 0) | ||
return r; | ||
|
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 addassert(u->manager);
at the beginning of the function.