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/load-fragment.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/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 5494d7bce4..22da6c1197 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1398,6 +1398,32 @@ int config_parse_service_sockets( return 0; } +int config_parse_service_timeout( + const char *filename, + unsigned line, + const char *section, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + Service *s = userdata; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(s); + + r = config_parse_usec(filename, line, section, lvalue, ltype, rvalue, data, userdata); + + if (!r) + s->timeout_defined = true; + + return r; +} + int config_parse_unit_env_file( const char *filename, unsigned line, |