diff options
author | Maciej Wereski <m.wereski@partner.samsung.com> | 2013-08-09 12:54:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-08-09 18:09:21 +0200 |
commit | b0693d30863a36da63d2a2732aa298fff6d34d0d (patch) | |
tree | 67bfd54b9ceee858aa6ec5e086f0acb74163f49d /src | |
parent | 41efeaec037678ac790e2a02df9020f83cc3a359 (diff) |
service: prohibit Restart= set when Type=oneshot
Diffstat (limited to 'src')
-rw-r--r-- | src/core/service.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c index df49ce1853..4070fd741b 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1113,6 +1113,12 @@ static int service_verify(Service *s) { return -EINVAL; } + if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) { + log_error_unit(UNIT(s)->id, + "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id); + return -EINVAL; + } + if (s->type == SERVICE_DBUS && !s->bus_name) { log_error_unit(UNIT(s)->id, "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id); |