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

Remove docker.socket from rpm based systems #24804

Merged
merged 1 commit into from Jul 19, 2016

Conversation

crosbymichael
Copy link
Contributor

Fixes #23981

The selinux issue we are seeing in the report is related to the socket
file for docker and nothing else. By removing the socket docker starts
up correctly.

However, there is another motivation for removing socket activation from
docker's systemd files and that is because when you have daemons running
with --restart always whenever you have a host reboot those daemons
will not be started again because the docker daemon is not started by
systemd until a request comes into the docker API.

Leave it for deb based systems because everything is working correctly
for both socket activation and starting normally at boot.

Signed-off-by: Michael Crosby crosbymichael@gmail.com

Fixes moby#23981

The selinux issue we are seeing in the report is related to the socket
file for docker and nothing else. By removing the socket docker starts
up correctly.

However, there is another motivation for removing socket activation from
docker's systemd files and that is because when you have daemons running
with --restart always whenever you have a host reboot those daemons
will not be started again because the docker daemon is not started by
systemd until a request comes into the docker API.

Leave it for deb based systems because everything is working correctly
for both socket activation and starting normally at boot.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
@crosbymichael
Copy link
Contributor Author

Packages tested with both ubuntu 16.04 and fedora 24

@runcom
Copy link
Member

runcom commented Jul 19, 2016

LGTM

@vdemeester
Copy link
Member

LGTM 🐸
/cc @tiborvass

@thaJeztah
Copy link
Member

are we only changing this for RPM installs?

@crosbymichael
Copy link
Contributor Author

because debs works and rpm does not

@tiborvass
Copy link
Contributor

For the record the only change for the service file is:

@@ -1,7 +1,7 @@
 [Unit]
 Description=Docker Application Container Engine
 Documentation=https://docs.docker.com
-After=network.target docker.socket
+After=network.target
 Requires=docker.socket

 [Service]
@@ -9,7 +9,7 @@
 # the default is not to use systemd for cgroups because the delegate issues still
 # exists and systemd currently does not support the cgroup feature set required
 # for containers run by docker
-ExecStart=/usr/bin/dockerd -H fd://
+ExecStart=/usr/bin/dockerd
 ExecReload=/bin/kill -s HUP $MAINPID
 # Having non-zero Limit*s causes performance problems due to accounting overhead
 # in the kernel. We recommend using cgroups to do container-local accounting.

LGTM

@crosbymichael
Copy link
Contributor Author

@tiborvass yes, that is the diff for the rpm version

@tiborvass tiborvass merged commit 39327a6 into moby:master Jul 19, 2016
@crosbymichael crosbymichael deleted the rpm-socket branch July 19, 2016 18:18
@rhatdan
Copy link
Contributor

rhatdan commented Jul 25, 2016

@crosbymichael How does Debian handle the Restart problem differently then RPM based systems?

@crosbymichael
Copy link
Contributor Author

@rhatdan the systemctl enable and start are run in post stop hooks for the install. The user is not expected to do this manually and when we created the RPMs we were told that on RPM based systems that was the opposite . When we created the RPMs we were told that on RPM based systems that the user knows and is expected to run these commands manually after the install.

@rhatdan
Copy link
Contributor

rhatdan commented Jul 25, 2016

Right no service should be enabled by default. Just installing a package should not imply that you want to run it.

I am questioning the use of docker.socket at all, since this blocks docker restart.

@crosbymichael
Copy link
Contributor Author

The socket is fine on ubuntu because we enable both the socket and the service. Because the service has the multi-user.target it is started at boot as well as having the socket activation if someone tries to access the socket before the daemon is started.

glensc added a commit to pld-linux/docker that referenced this pull request Aug 29, 2016
note: moby/moby#24804 does not apply to pld
as docker.service is registered at startup (enabled by default)
liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
Fixes moby#23981

The selinux issue we are seeing in the report is related to the socket
file for docker and nothing else. By removing the socket docker starts
up correctly.

However, there is another motivation for removing socket activation from
docker's systemd files and that is because when you have daemons running
with --restart always whenever you have a host reboot those daemons
will not be started again because the docker daemon is not started by
systemd until a request comes into the docker API.

Leave it for deb based systems because everything is working correctly
for both socket activation and starting normally at boot.

External Link: moby#24804

Signed-off-by: Michael Crosby <michael@docker.com>

Signed-off-by: xiekeyang <xiekeyang@huawei.com>
liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
…rting

Follow up commit 57ded30. To fix that
docker client can not get response when racing with docker daemon
starting. This is for EulerOS platform.

External Link: moby#24804

Signed-off-by: xiekeyang <xiekeyang@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants