Subject: Re: bug#55936: dockerd fails to start on boot

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 15 Jul 2022 21:55:08 -0400

Hi,

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Maxim Cournoyer <[email-masked]> skribis:
>
>> I've researched more on the topic, and it appears what I had on mind is
>> rather systemd's socket *notification* (what they call 'sdNotify')
>> rather than activation.  Activation is just to lazy start things... it
>> probably wouldn't help here, rather it seems it'd be a bad idea, as
>> realized elsewhere [0].
>>
>> [0]  https://github.com/containerd/containerd/issues/164#issuecomment-657536515
>
> Currently the Shepherd implements activation as lazy start, but we
> should add an option for “eager socket activation” where the daemon is
> started right away.
>
> Such activation is still useful as a synchronization mechanism: you can
> tell the service is ready to serve requests as soon as the socket has
> been created.

But this relies on the application behaving that way (e.g., waiting for
the socket to be opened, rather than expecting things to be ready and
failing), right?

If I understand correctly, the sdNotify mechanism in systemd is a means
that let the application notify systemd when it is ready, so that
systemd itself can ensure the ordering relationships.  So on systemd
containerd would be marked as 'starting' by systemd until it notifies it
that it's good via sdNotify, and docker.service would be waiting on it
until after containerd has started since it is ordered to start after it
[0]

[0]  https://github.com/moby/moby/blob/master/contrib/init/systemd/docker.service#L4

Thanks,

Maxim