Comment 7 for bug 1930393

Revision history for this message
Stephane Chazelas (stephane-chazelas+lp) wrote :

From systemd.service(5):

> Type=
> Configures the process start-up type for this service unit.
> One of simple, exec, forking, oneshot, dbus, notify or
> idle:
>
> • If set to simple (the default if ExecStart= is
> specified but neither Type= nor BusName= are), the
> service manager will consider the unit started
> immediately after the main service process has been
> forked off.
[...]
> • If set to forking, it is expected that the process
> configured with ExecStart= will call fork() as part of
> its start-up. The parent process is expected to exit
> when start-up is complete and all communication
> channels are set up. The child continues to run as the
> main service process, and the service manager will
> consider the unit started when the parent process
> exits. This is the behavior of traditional UNIX
> services. If this setting is used, it is recommended to
> also use the PIDFile= option, so that systemd can
> reliably identify the main process of the service.
> systemd will proceed with starting follow-up units as
> soon as the parent process exits.

So as long as the parent doesn't exit before the service is ready to accept connections, it should be reliable.

It seems to be the case here. Note that clamd can take quite a long time to start (hence the 7 minute timeout which btw I don't think makes sense with type=simple and --foreground), which might be why type=forking was abandoned?