diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-10-16 21:19:43 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-10-22 19:51:01 +0200 |
commit | 78270121c37d94b1ce6968344bdfe3df10245b0d (patch) | |
tree | 6f3336254f995c29b49ef37e2fdc66ccc37e9412 /src/core | |
parent | core/service: call service_enter_running() if live mount fails (diff) | |
download | systemd-78270121c37d94b1ce6968344bdfe3df10245b0d.tar.xz systemd-78270121c37d94b1ce6968344bdfe3df10245b0d.zip |
core/service: add missing serialization for Service.live_mount_result
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/service.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/service.c b/src/core/service.c index c7683090ef..5930fade06 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3088,6 +3088,7 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) { (void) serialize_item(f, "state", service_state_to_string(s->state)); (void) serialize_item(f, "result", service_result_to_string(s->result)); (void) serialize_item(f, "reload-result", service_result_to_string(s->reload_result)); + (void) serialize_item(f, "live-mount-result", service_result_to_string(s->live_mount_result)); (void) serialize_pidref(f, fds, "control-pid", &s->control_pid); if (s->main_pid_known) @@ -3316,7 +3317,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, state = service_state_from_string(value); if (state < 0) - log_unit_debug(u, "Failed to parse state value: %s", value); + log_unit_debug_errno(u, state, "Failed to parse state value: %s", value); else s->deserialized_state = state; } else if (streq(key, "result")) { @@ -3324,7 +3325,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, f = service_result_from_string(value); if (f < 0) - log_unit_debug(u, "Failed to parse result value: %s", value); + log_unit_debug_errno(u, f, "Failed to parse result value: %s", value); else if (f != SERVICE_SUCCESS) s->result = f; @@ -3333,10 +3334,19 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, f = service_result_from_string(value); if (f < 0) - log_unit_debug(u, "Failed to parse reload result value: %s", value); + log_unit_debug_errno(u, f, "Failed to parse reload result value: %s", value); else if (f != SERVICE_SUCCESS) s->reload_result = f; + } else if (streq(key, "live-mount-result")) { + ServiceResult f; + + f = service_result_from_string(value); + if (f < 0) + log_unit_debug_errno(u, f, "Failed to parse live mount result value: %s", value); + else if (f != SERVICE_SUCCESS) + s->live_mount_result = f; + } else if (streq(key, "control-pid")) { if (!pidref_is_set(&s->control_pid)) |