aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils-systemd.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-07-20 22:04:11 -0400
committerScott Murray <scott.murray@konsulko.com>2020-07-22 21:55:35 -0400
commit55e6be446553dd0e813c0de1cc60a81f11dddda0 (patch)
tree20a4e80656a1cca60c4b3a09ba1661bf59f7a588 /src/utils-systemd.h
parentac6f7ed88291b81cb70981bd7463b6a3b292fece (diff)
Add wait for start jobs
The systemd job to start an application unit may remain queued long enough after a call into the systemd D-Bus API that the subsequent state check sees the unit as still inactive. This results in the application start being incorrectly reported as having failed, when it will still actually proceed once the job is dequeued and run in systemd. To fix this, checking of the state of the job object returned by the start D-Bus calls has been added in the various wrapper functions in src/utils-systemd.c. The timeout mechanism used in the new job_wait helper function is based on the existing state checking logic of the wait_state_stable function in src/afm-urun.c. Bug-AGL: SPEC-3365, SPEC-3427, SPEC-3457 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I01077a4213944233506518869c3dc604bd40f693
Diffstat (limited to 'src/utils-systemd.h')
-rw-r--r--src/utils-systemd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils-systemd.h b/src/utils-systemd.h
index 3bddfd6..6d43c71 100644
--- a/src/utils-systemd.h
+++ b/src/utils-systemd.h
@@ -28,6 +28,12 @@ enum SysD_State {
SysD_State_Failed
};
+enum SysD_Job_State {
+ SysD_Job_State_INVALID,
+ SysD_Job_State_Waiting,
+ SysD_Job_State_Running
+};
+
struct sd_bus;
extern int systemd_get_bus(int isuser, struct sd_bus **ret);
extern void systemd_set_bus(int isuser, struct sd_bus *bus);