chiark / gitweb /
service: don't allow reload operations for oneshot services
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Jan 2011 17:44:06 +0000 (18:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Jan 2011 17:44:09 +0000 (18:44 +0100)
During starting of oneshot we are in START state which we don't want to
combine with the RELOAD state, hence we disallow both at the same time.

src/service.c

index 4115e52901fd4e22cfb8101ff8f14e1203d0cf96..03a858a4ae38e0b322eeccee118201ee83d81ad5 100644 (file)
@@ -1029,6 +1029,12 @@ static int service_verify(Service *s) {
                 return -EINVAL;
         }
 
+        if (s->type == SERVICE_ONESHOT &&
+            s->exec_command[SERVICE_EXEC_RELOAD]) {
+                log_error("%s has an ExecReload setting, which is not allowed for Type=oneshot services. Refusing.", s->meta.id);
+                return -EINVAL;
+        }
+
         if (s->type == SERVICE_DBUS && !s->bus_name) {
                 log_error("%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", s->meta.id);
                 return -EINVAL;