1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

5 commits

Author SHA1 Message Date
Akihiro Suda
7af0344f9b
Merge pull request #37470 from harmathy/patch-1
Allow socket activation
2020-03-03 10:48:21 +09:00
Wiktor Kwapisiewicz
8abf26dbfb
Change docker socket location to /run/docker.sock
This change resolves the following systemd warning:

```
/usr/lib/systemd/system/docker.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock → /run/docker.sock; please update the unit file accordingly.
```

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
2019-05-28 23:22:54 +02:00
Max Harmathy
28e93ed8ca
Allow socket activation
PartOf deactivates the socket whenever the service get deactivated. The socket unit however should be active nevertheless.

Signed-off-by: Max Harmathy <max.harmathy@web.de>
2018-07-16 14:36:02 +02:00
Eric Paris
053c3557b3 Fix system socket/service unit files
Two problems how they are today:

In the current systemd unit files it is impossible to have the
docker.service started at system boot.  Instead enableing docker.service
will actually enable docker.socket.  This is a problem, as that means
any container with --restart=always will not launch on reboot.  And of
course as soon as you log in and type docker ps, docker.service will be
launched and now your images are running.  Talk about a PITA to debug!
The fix is to just install docker.service when people ask docker.service
to be enabled.  If an admin wants to enable docker.socket instead, that
is fine and will work just as it does today.

The second problem is a common docker devel workflow, although not
something normal admins would hit.  In this case consider a dev doing
the following:

systemctl stop docker.service

docker -d
[run commands]
[^C]

systemctl start docker.service

Running docker -d (without -F fd://) will clean up the
/var/run/docker.sock when it exits.  Remember, you just ran the docker
daemon not telling it about socket actviation, so cleaning up its socket
makes sense!  The new docker, started by systemd will expect socket
activation, but the last one cleaned up the docker.sock.  So things are
just broken.  You can, today, work around this by restarting
docker.socket.  This fixes it by telling docker.socket that it is
PartOf=docker.service.  So when docker.service is
started/stopped/restarted docker.socket will also be
started/stopped/restarted.  So the above semi-common devel workflow will
be fine.  When docker.service is stopped, so is docker.socket,   docker
-d (without -F fd://) will create and delete /var/run/docker.sock.
Starting docker.service again will restart docker.socket, which will
create the file an all is happy in the word.

Signed-off-by: Eric Paris <eparis@redhat.com>
2014-10-07 14:09:08 -04:00
Lokesh Mandvekar
076ac1d7d2 use systemd socket-activation by default
modified:   contrib/init/systemd/docker.service
	renamed:    contrib/init/systemd/socket-activation/docker.socket -> contrib/init/systemd/docker.socket
	deleted:    contrib/init/systemd/socket-activation/docker.service

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> (github: lsm5)
2014-07-14 17:41:07 -05:00
Renamed from contrib/init/systemd/socket-activation/docker.socket (Browse further)