summaryrefslogtreecommitdiffstats
path: root/src/utils-systemd.c
AgeCommit message (Collapse)AuthorFilesLines
2020-07-23Fix native compilationjellyfish_9.99.4jellyfish_9.99.3jellyfish_9.99.2jellyfish/9.99.4jellyfish/9.99.3jellyfish/9.99.29.99.49.99.39.99.2Scott Murray1-0/+1
The use of nanosleep in the previous job wait change fails to build for me when building af-main-native, so add the required #include of time.h. It's not clear to me right off why it actually built for the target without it, that behavior difference may warrant some further investigation. Bug-AGL: SPEC-3365, SPEC-3427, SPEC-3457 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I73203e564c96d3eaea250ce8867149f6a155ec07
2020-07-22Add wait for start jobsScott Murray1-0/+60
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
2020-05-19Improve use of systemd's statesJosé Bollo1-26/+45
A better handling of systemd state is need to treat correctly transient states. That change includes: - Management of states with numeric identifiers instead of names - Handling of the state "inactive" as a stable state. Most of previous seen problems were coming from that miss. - Returning no error but also no info on the process if it falled to "inactive" meaning that it stopped quickly. Bug-AGL: SPEC-3323 Change-Id: Ibf35eb6257c5583596d675cad0bec2869f5fd5f7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2020-01-08Update copyrightJosé Bollo1-1/+1
Change-Id: I1d68e07563d9f0f139d1bc8128e09a5da0a648af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-07Update date in copyrightssandbox/scottrif29/scottdocsJosé Bollo1-1/+1
Change-Id: Ie2ff321f78c59913373e2ffb2820297fd423d6f4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-28Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: Ia4ef2a6e3c07616ccd756933a82f0806844c4faf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-24Restore compilation of native-sdkJosé Bollo1-0/+1
Change-Id: I3855854407ad47c2b9a2288b8425513de5ae94d3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-24utils-systemd: Offer way to set systemd's busesJosé Bollo1-14/+23
Change-Id: I8035c10e8f769b7912046b432d43f97297c039b2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-06-23Fix socket (de)activation at (de)installJosé Bollo1-0/+44
When installing or deinstalling, it is needed to issue a "systemctl (--user) restart sockets.target" This patch implement it on user side. To be improved. Change-Id: I152eb6a1cf5df50b1fe3143837d6d42ee6619349 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17utils-systemd: implement start/stop of unitsx-first-with-systemdJosé Bollo1-15/+341
This implementation is very basic and must be improved. Change-Id: Id1540e646c83285c61849092bbd8fb645c0954ed Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17Allows to compile without libsystemdJosé Bollo1-2/+9
This fixes a problem with bitbake when building native packages. Change-Id: I28586720010237db578ec55cb5254212c88240e7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17utils-systemd: provide enumeration of unitsJosé Bollo1-18/+115
This enumeration is based on the filesystem, units are listed from the configured directory. This is necessarily because not all units can be loaded by systemd but all can be started. Change-Id: Ic4d1331c8c54f5bbaa747ff8084da2b0c5a65c55 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17Use the same dbus connectionJosé Bollo1-2/+2
Opening one connection per part of the program doesn't make sense and waste resources. Using a common one is much better. Change-Id: I74dc3cd7ae41d7bfa2f03f4a252495e8f5f81578 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17Emits reload to systemd when neededJosé Bollo1-0/+41
The current implementation enforce the reload when a 'wants' target is created or deleted. This should work well for system units. However, for system units, this behaviour isn't enought when more that a user is active because only the user that installs the application will be updated. For this reason, a paralelle mechanism has to be defined. Also note that systemd is henceforth required for tools because wgtpkg-installer needs it now. Change-Id: I4fc03a44dbc58c2374ea21dbf6b436f646d04e00 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-17utils-systemd: introduction of systemd interfaceJosé Bollo1-0/+77
Isolate the interface to systemd. Change-Id: I03ea654da9fab2df0e6eec980b0e5623487d1b73 Signed-off-by: José Bollo <jose.bollo@iot.bzh>