chiark / gitweb /
core: allow Type=oneshot services to have ExecReload
authorMantas Mikulėnas <grawity@gmail.com>
Wed, 10 Oct 2012 17:18:42 +0000 (20:18 +0300)
committerLennart Poettering <lennart@poettering.net>
Mon, 15 Oct 2012 23:36:18 +0000 (01:36 +0200)
Use cases:

 * iptables.service – atomically reload rules without having to flush
   them beforehand (which may leave the system insecure if reload fails)

 * rpc-nfsd.service – reexport filesystems after /etc/exports update
   without completely stopping and restarting nfsd

(In both cases, the actual service is provided by a kernel module and
does not have any associated user-space processes, thus Type=oneshot.)

src/core/service.c

index 8d315c1f7516a3bec166598e318b7ccf8ffef08f..69c71508f8145285ca120e3054495557af7c34f8 100644 (file)
@@ -1161,12 +1161,6 @@ 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.", UNIT(s)->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.", UNIT(s)->id);
                 return -EINVAL;