diff options
author | Denys Dmytriyenko <denys@konsulko.com> | 2023-04-11 01:33:09 +0000 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2023-04-14 10:39:51 +0000 |
commit | 04f14d40ba4559ce18e9b59efa95c902d94c940c (patch) | |
tree | 9182bcfafc4592c981e3f186a38ac7ca3577ad7e | |
parent | 61d9c855dd4f7c63774ca3271d41b60e6fadc558 (diff) |
Handle "failed" signaloctopus
When application exits abnormally, it emits "failed" signal, instead of
"inactive" one. Handle it accordingly, so the internal state doesn't get
out of sync and prevents starting the app again.
Bug-AGL: SPEC-4199
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Change-Id: I307a6c6973f98d8f57af477bc03ebfb1218559db
(cherry picked from commit 5cab14e6a98519e0b6c6043a1a19e42f094d6522)
-rw-r--r-- | src/systemd_manager.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/systemd_manager.c b/src/systemd_manager.c index e6d67f8..7eba643 100644 --- a/src/systemd_manager.c +++ b/src/systemd_manager.c @@ -363,6 +363,15 @@ static void unit_properties_changed_cb(GDBusProxy *proxy, g_signal_emit(data->mgr, signals[STARTED], 0, app_info_get_app_id(app_info)); } } + else if(!g_strcmp0(new_state, "failed")) + { + g_debug("Application %s has failed", app_info_get_app_id(app_info)); + app_info_set_status(app_info, APP_STATUS_INACTIVE); + app_info_set_runtime_data(app_info, NULL); + + g_signal_emit(data->mgr, signals[TERMINATED], 0, app_info_get_app_id(app_info)); + systemd_manager_free_runtime_data(data); + } g_free(new_state); } |