Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10] fix systemd startup order #575

Merged
merged 1 commit into from Dec 23, 2021

Conversation

thaJeztah
Copy link
Member

This applies the same fix as was added in moby/moby@fe68df3, to address docker/for-linux#989 (comment)

The systemd unit only contained a Requires= for the docker.socket, but failed
to add it to After=. The Requires= option only defines that a dependency
must be present, but does not influence startup order. From the systemd docs:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Wants=

Wants=

(..)
Note that requirement dependencies do not influence the order in which services
are started or stopped. This has to be configured independently with the After=
or Before= options. (...)

As a result, the docker service could start before the socket was created, and
would fail to start.

This applies the same fix as was added in moby/moby@fe68df3.

The systemd unit only contained a `Requires=` for the `docker.socket`, but failed
to add it to `After=`. The `Requires=` option only defines that a dependency
must be present, but does not influence startup order. From the systemd docs:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Wants=

> Wants=
>
> (..)
> Note that requirement dependencies do not influence the order in which services
> are started or stopped. This has to be configured independently with the `After=`
> or `Before=` options. (...)

As a result, the `docker` service could start before the socket was created, and
would fail to start.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@jhult
Copy link

jhult commented Dec 11, 2021

@thaJeztah, any news on this being merged?

@thaJeztah
Copy link
Member Author

oh! I forgot this one was still pending.

This will have to be reviewed by others. We're looking at doing an extra release of docker engine to include an updated version of docker scan (to help users with https://www.docker.com/blog/apache-log4j-2-cve-2021-44228/), but perhaps after that's done, this should be ok to go for a patch release after that.

@fredericdalleau @tianon ptal

Copy link
Contributor

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@thaJeztah
Copy link
Member Author

Thanks for review! let's merge this one

@thaJeztah thaJeztah merged commit e1d894f into docker:20.10 Dec 23, 2021
@thaJeztah thaJeztah deleted the 20.10_fix_systemd_startup_order branch December 23, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants