Skip to content

Add PIDFile to docker.service unit file to make systemd clean up pid file more reliably#499

Closed
qiutongs wants to merge 1 commit into
docker:masterfrom
qiutongs:master
Closed

Add PIDFile to docker.service unit file to make systemd clean up pid file more reliably#499
qiutongs wants to merge 1 commit into
docker:masterfrom
qiutongs:master

Conversation

@qiutongs
Copy link
Copy Markdown

For details, refer to moby/moby#41465

…file more reliably

- What I did
In docker.service unit file, add a PIDFile option with the default pid file path of docker.

- Why I did

In the case of a high churn process system there is an edge case where the process is killed and the process id is assigned to a new running process before systemd can restart the process and see that no process is running under the old pid. When the in-use PIDs is close to the system capacity, it's likely that the PID has been reused by some other process. The dockerd does a check to see if the pid file exist and the process id in the file is running[3]. In this case, docker will fail to restart since the pid file contains a valid, running process.

So configuring the PIDFile in docker.service, systemd will help cleanup the pid file more reliably.

- How I did it

Updated the docker.service

- How to verify it

Try to simulate the high churn behavior.

Signed-off-by: Qiutong Song <qiutongs@google.com>
@thaJeztah
Copy link
Copy Markdown
Member

We upstreamed the systemd unit files from this repository back to moby/moby (moby/moby#42373) and removed them in this repository (#547), so let's close this one in favour of moby/moby#41465 (looks like there's still some discussion ongoing on that PR), thanks!

@thaJeztah thaJeztah closed this May 21, 2021
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.

2 participants