diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2012-06-14 17:07:07 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-06-15 16:04:06 +0200 |
commit | 98709151f3e782eb508ba15e2a12c0b46003f061 (patch) | |
tree | 5be8acdbae6ef52d40125302b8317f290e14a0db /src/core/service.c | |
parent | 34cdc274edd870ffc27d21cf82655a0114948748 (diff) |
service: timeout for oneshot services
Add possibility to specify timeout for oneshot services.
[ https://bugzilla.redhat.com/show_bug.cgi?id=761656
Added minor fixups. -- michich ]
Diffstat (limited to 'src/core/service.c')
-rw-r--r-- | src/core/service.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c index 936fee2636..8941271679 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1249,6 +1249,10 @@ static int service_load(Unit *u) { if (s->type == _SERVICE_TYPE_INVALID) s->type = s->bus_name ? SERVICE_DBUS : SERVICE_SIMPLE; + /* Oneshot services have disabled timeout by default */ + if (s->type == SERVICE_ONESHOT && !s->timeout_defined) + s->timeout_usec = 0; + service_fix_output(s); if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0) @@ -2157,7 +2161,7 @@ static void service_enter_start(Service *s) { r = service_spawn(s, c, - s->type == SERVICE_FORKING || s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY, + s->type == SERVICE_FORKING || s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY || s->type == SERVICE_ONESHOT, true, true, true, @@ -2372,7 +2376,7 @@ static void service_run_next_main(Service *s) { r = service_spawn(s, s->main_command, - false, + true, true, true, true, |