1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 02:57:16 +03:00

core: don't unset reload result, unless we begin a start or reload operation

Much like the result of the service itself we should not reset the
reload result unless we actually start from the beginning, so that
clients can query it at any time.

Specifically, let's reset the result states only when we begin with a
start operation (for both the main result, and the reload result), when
we begin with a reload operation (only for the load result), or when the
use explicitly asks for that via "systemctl reset-failed".

This is a more generic fix for #1447.

Fixes #1447.
This commit is contained in:
Lennart Poettering 2015-10-03 13:37:21 +02:00
parent 6c1695be47
commit 95c906ae07

View File

@ -884,7 +884,6 @@ static void service_set_state(Service *s, ServiceState state) {
log_unit_debug(UNIT(s), "Changed %s -> %s", service_state_to_string(old_state), service_state_to_string(state)); log_unit_debug(UNIT(s), "Changed %s -> %s", service_state_to_string(old_state), service_state_to_string(state));
unit_notify(UNIT(s), table[old_state], table[state], s->reload_result == SERVICE_SUCCESS); unit_notify(UNIT(s), table[old_state], table[state], s->reload_result == SERVICE_SUCCESS);
s->reload_result = SERVICE_SUCCESS;
} }
static int service_coldplug(Unit *u) { static int service_coldplug(Unit *u) {
@ -1778,6 +1777,7 @@ static void service_enter_reload(Service *s) {
assert(s); assert(s);
service_unwatch_control_pid(s); service_unwatch_control_pid(s);
s->reload_result = SERVICE_SUCCESS;
s->control_command = s->exec_command[SERVICE_EXEC_RELOAD]; s->control_command = s->exec_command[SERVICE_EXEC_RELOAD];
if (s->control_command) { if (s->control_command) {