-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Clean up the docker socket on termination of the daemon. #6962
Conversation
closes #3349 |
Doesn't closing the socket remove the "file" on *nix systems? Couldn't we just close the sockets instead of path splitting (or do we not store them in the daemon structure)? |
@cyphar the problem is it needs to be handled there -- I can investigate the close, but I have not heard this before, nor does the socket go away on server termination, which this fixes. I would think that the socket would be closed at that point. |
@@ -98,6 +110,7 @@ func InitServer(job *engine.Job) engine.Status { | |||
log.Printf("Received signal '%v', starting shutdown of docker...\n", sig) | |||
switch sig { | |||
case os.Interrupt, syscall.SIGTERM: | |||
srv.removeUnixSockets() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be one of the last things that you do before calling os.Exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(as usual)
Fixed according to @crosbymichael's comments. Please review. |
excellent - could someone please push this patch into the |
Yeah, I can apply it later. Will ping then. -Erik
|
I can address this independently. Can we review this standalone? I think it's ready. |
LGTM |
@erikh needs a simple rebase. |
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
@tiborvass done |
ping @tiborvass |
LGTM |
1 similar comment
LGTM |
Clean up the docker socket on termination of the daemon.
Please review. I feel like there's more cases here I'm missing, but I'm not sure where they might be.
Thanks!