mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 15:21:37 +03:00
systemctl: fix issue with systemctl daemon-reexec
This commit is contained in:
parent
fd5b4ca11e
commit
c516c8d17f
@ -1287,7 +1287,8 @@ int bus_method_call_with_reply(DBusConnection *bus,
|
|||||||
reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
|
reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
|
||||||
dbus_message_unref(m);
|
dbus_message_unref(m);
|
||||||
if (!reply) {
|
if (!reply) {
|
||||||
log_error("Failed to issue method call: %s", bus_error_message(&error));
|
if (!return_error)
|
||||||
|
log_error("Failed to issue method call: %s", bus_error_message(&error));
|
||||||
if (bus_error_is_no_service(&error))
|
if (bus_error_is_no_service(&error))
|
||||||
r = -ENOENT;
|
r = -ENOENT;
|
||||||
else if (dbus_error_has_name(&error, DBUS_ERROR_ACCESS_DENIED))
|
else if (dbus_error_has_name(&error, DBUS_ERROR_ACCESS_DENIED))
|
||||||
|
@ -1537,11 +1537,12 @@ static int start_unit_one(
|
|||||||
DBUS_TYPE_INVALID);
|
DBUS_TYPE_INVALID);
|
||||||
free(n);
|
free(n);
|
||||||
if (r) {
|
if (r) {
|
||||||
if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL ) {
|
if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL )
|
||||||
/* There's always a fallback possible for
|
/* There's always a fallback possible for
|
||||||
* legacy actions. */
|
* legacy actions. */
|
||||||
r = -EADDRNOTAVAIL;
|
r = -EADDRNOTAVAIL;
|
||||||
}
|
else
|
||||||
|
log_error("Failed to issue method call: %s", bus_error_message(error));
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3143,6 +3144,7 @@ finish:
|
|||||||
static int daemon_reload(DBusConnection *bus, char **args) {
|
static int daemon_reload(DBusConnection *bus, char **args) {
|
||||||
int r;
|
int r;
|
||||||
const char *method;
|
const char *method;
|
||||||
|
DBusError error;
|
||||||
|
|
||||||
if (arg_action == ACTION_RELOAD)
|
if (arg_action == ACTION_RELOAD)
|
||||||
method = "Reload";
|
method = "Reload";
|
||||||
@ -3171,7 +3173,7 @@ static int daemon_reload(DBusConnection *bus, char **args) {
|
|||||||
"org.freedesktop.systemd1.Manager",
|
"org.freedesktop.systemd1.Manager",
|
||||||
method,
|
method,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
&error,
|
||||||
DBUS_TYPE_INVALID);
|
DBUS_TYPE_INVALID);
|
||||||
|
|
||||||
if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL)
|
if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL)
|
||||||
@ -3182,6 +3184,9 @@ static int daemon_reload(DBusConnection *bus, char **args) {
|
|||||||
/* On reexecution, we expect a disconnect, not
|
/* On reexecution, we expect a disconnect, not
|
||||||
* a reply */
|
* a reply */
|
||||||
r = 0;
|
r = 0;
|
||||||
|
else if (r)
|
||||||
|
log_error("Failed to issue method call: %s", bus_error_message(&error));
|
||||||
|
dbus_error_free(&error);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user