32

I've reinstalled Docker. When I'm trying to start Docker, everything is fine:

# /etc/init.d/docker start
[ ok ] Starting docker (via systemctl): docker.service.

until I want to stop Docker service and many times restart it:

# /etc/init.d/docker stop

[....] Stopping docker (via systemctl): docker.serviceWarning: Stopping docker.service, but it can still be activated by:
  docker.socket
. ok 

Finally, I've got error:

# /etc/init.d/docker start
[....] Starting docker (via systemctl): docker.serviceJob for docker.service failed.
See "systemctl status docker.service" and "journalctl -xe" for details.
 failed!

# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit-hit) since Sat 2017-11-25 20:04:20 CET; 2min 4s ago
     Docs: https://docs.docker.com
  Process: 12845 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=0/SUCCESS)
 Main PID: 12845 (code=exited, status=0/SUCCESS)
      CPU: 326ms

Nov 25 20:04:18 example.com systemd[1]: Started Docker Application Container Engine.
Nov 25 20:04:18 example.com dockerd[12845]: time="2017-11-25T20:04:18.191949863+01:00" level=inf
Nov 25 20:04:19 example.com systemd[1]: Stopping Docker Application Container Engine...
Nov 25 20:04:19 example.com dockerd[12845]: time="2017-11-25T20:04:19.368990531+01:00" level=inf
Nov 25 20:04:19 example.com dockerd[12845]: time="2017-11-25T20:04:19.37953454+01:00" level=info
Nov 25 20:04:20 example.com systemd[1]: Stopped Docker Application Container Engine.
Nov 25 20:04:21 example.com systemd[1]: docker.service: Start request repeated too quickly.
Nov 25 20:04:21 example.com systemd[1]: Failed to start Docker Application Container Engine.
Nov 25 20:04:21 example.com systemd[1]: docker.service: Unit entered failed state.
Nov 25 20:04:21 example.com systemd[1]: docker.service: Failed with result 'start-limit-hit'.

I've installed Docker on Debian 9 Stretch.

Can anyone help me get rid of this warning and resolve an error "Failed with result 'start-limit-hit'"?

2 Answers2

88

Simply start and stop the socket if the docker is triggered by the socket

sudo systemctl stop docker.socket
tuhin47
  • 5,172
  • 4
  • 19
  • 29
16

This is because in addition to the docker.service unit file, there is a docker.socket unit file... this is for socket activation. The warning means if you try to connect to the docker socket while the docker service is not running, then systemd will automatically start docker for you. You can get rid of this by removing /lib/systemd/system/docker.socket... you may also need to remove -H fd:// from the docker.service unit file.

cpuguy83
  • 5,794
  • 4
  • 18
  • 24
  • Removing the docker socket from systemd didn't resolve the issue for me. Afterwards stopping docker pops up the same message and `service docker status` does show docker active and triggeredBy docker.socket – Tanel Jan 26 '22 at 07:58
  • And removing the -H fd:// causes `sudo service docker start` to fail with Unit docker.socket not found. – Tanel Jan 26 '22 at 08:10