Doesn't start after installation

Bug #1459916 reported by Kai Mast on 2015-05-29
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Undecided
Unassigned
Vivid
Undecided
Unassigned

Bug Description

[SRU Description]

[Impact]
This bug affect the start of the docker daemon, as it isn't started after installation.
Upgrade is broken also when using a direct backport from wily.

Some ajustment had to be done in docker.io.postinst to correct this upgrade behavior.

[Test Case]
start a fresh installed vivid
sudo apt-get update && sudo apt-get install docker.io
sudo systemctl status docker.socket show that the daemon is not started.

Actual results:
● docker.socket - Docker Socket for the API
   Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor reset:enabled)
   Active: inactive (dead)
   Listen: /var/run/docker.sock (Stream)

To test this proposed package
you can on a fresh installation each time:

1-Install the proposed package directly, and check that docker.socket service is active

  sudo systemctl status docker.socket
  Expected results:
    ● docker.socket - Docker Socket for the API
       Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
       Active: active (running) since Fri 2015-06-26 16:05:46 UTC; 19s ago
       Listen: /var/run/docker.sock (Stream)

    sudo docker version
  Expected results:
    Client version: 1.6.2
    Client API version: 1.18
    Go version (client): go1.3.3
    Git commit (client): 7c8fca2
    OS/Arch (client): linux/amd64
    Server version: 1.6.2
    Server API version: 1.18
    Go version (server): go1.3.3
    Git commit (server): 7c8fca2
    OS/Arch (server): linux/amd64

2-On a fresh vivid install, install docker-1.5.0,
    sudo docker version:
  expected results:
    Client version: 1.5.0
    Client API version: 1.17
    Go version (client): go1.3.3
    Git commit (client): a8a31ef
    OS/Arch (client): linux/amd64
    FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

  then upgrade to proposed package, and check if docker service is active.

    sudo systemctl status docker.socket,
  expected results:
  ● docker.socket - Docker Socket for the API
     Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2015-06-26 16:15:18 UTC; 23s ago
     Listen: /var/run/docker.sock (Stream)

    sudo docker version;
  Expected results:
    Client version: 1.6.2
    Client API version: 1.18
    Go version (client): go1.3.3
    Git commit (client): 7c8fca2
    OS/Arch (client): linux/amd64
    Server version: 1.6.2
    Server API version: 1.18
    Go version (server): go1.3.3
    Git commit (server): 7c8fca2
    OS/Arch (server): linux/amd64

3-Install docker-1.5.0,
    start service manually:
    sudo systemctl start docker.socket && sudo systemctl status docker.socket
  Expected results:
    ● docker.socket - Docker Socket for the API
       Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
       Active: active (listening) since Fri 2015-06-26 16:20:41 UTC; 7ms ago
       Listen: /var/run/docker.sock (Stream)

  then upgrade to proposed package, and check if docker service is active.

    sudo systemctl status docker.socket,
  expected results:
  ● docker.socket - Docker Socket for the API
     Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2015-06-26 16:15:18 UTC; 23s ago
     Listen: /var/run/docker.sock (Stream)

    sudo docker version;
  Expected results:
    Client version: 1.6.2
    Client API version: 1.18
    Go version (client): go1.3.3
    Git commit (client): 7c8fca2
    OS/Arch (client): linux/amd64
    Server version: 1.6.2
    Server API version: 1.18
    Go version (server): go1.3.3
    Git commit (server): 7c8fca2
    OS/Arch (server): linux/amd64

[Regression Potential]
This fix reset the saved state of systemd docker.service and docker.socket units,
so it may affect a user that has installed docker.io (1.5.0~dfsg1-1ubuntu2),
then rebooted or manually started the service, then has manually shutdown the service.
The last state will be reset.

It is worth noting than since docker.io-1.6.0~rc4~dfsg1-1,
the docker.service is marked on-boot, so docker.socket is not so usefull anymore.
It is retained for minimizing divergence with upstream.

[Original Bug Description]

I need to manually invoke "systemctl start docker.socket".

Youhei Tooyama (ytooyama) wrote :

Me too.

workaround is:

root@ubuntu:~# apt-get update && apt-get -y install docker.io
root@ubuntu:~# service docker start
root@ubuntu:~# service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2015-06-12 10:31:40 JST; 2s ago
     Docs: http://docs.docker.com
 Main PID: 4953 (docker)
   CGroup: /system.slice/docker.service
           └─4953 /usr/bin/docker -d -H fd://

Jun 12 10:31:40 ubuntu docker[4953]: time="2015-06-12T10:31:40+09:00" level=info msg="+job se...//)"
Jun 12 10:31:40 ubuntu docker[4953]: time="2015-06-12T10:31:40+09:00" level=info msg="Listeni... ()"
Jun 12 10:31:40 ubuntu docker[4953]: time="2015-06-12T10:31:40+09:00" level=info msg="+job in...r()"
Jun 12 10:31:40 ubuntu docker[4953]: time="2015-06-12T10:31:40+09:00" level=info msg="-job in...(0)"
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="WARNING...it."
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="Loading...rt."
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="Loading...ne."
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="docker ...ufs"
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="+job ac...s()"
Jun 12 10:31:41 ubuntu docker[4953]: time="2015-06-12T10:31:41+09:00" level=info msg="-job ac...(0)"
Hint: Some lines were ellipsized, use -l to show in full.

root@ubuntu:~# docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.3.3
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.3.3
Git commit (server): a8a31ef

or reboot after docker.io installation.

Youhei Tooyama (ytooyama) wrote :

[Update]The following combinations to work.

systemd (219-7ubuntu6)
docker.io (1.5.0~dfsg1-1ubuntu2)

~# systemctl start docker
~# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2015-06-18 12:04:32 JST; 1s ago
     Docs: http://docs.docker.com
 Main PID: 1875 (docker)
   CGroup: /system.slice/docker.service
           ├─1875 /usr/bin/docker -d -H fd://
           └─1942 /sbin/apparmor_parser -r -W docker

Jun 18 12:04:32 vivid-docker systemd[1]: Started Docker Application Container Engine.
Jun 18 12:04:32 vivid-docker systemd[1]: Starting Docker Application Container Engine...
Jun 18 12:04:32 vivid-docker docker[1875]: time="2015-06-18T12:04:32+09:00" level=info msg="+j.../)"
Jun 18 12:04:32 vivid-docker docker[1875]: time="2015-06-18T12:04:32+09:00" level=info msg="Li...()"
Jun 18 12:04:32 vivid-docker docker[1875]: time="2015-06-18T12:04:32+09:00" level=info msg="+j...()"
Jun 18 12:04:33 vivid-docker docker[1875]: time="2015-06-18T12:04:33+09:00" level=info msg="-j...0)"
Jun 18 12:04:33 vivid-docker docker[1875]: time="2015-06-18T12:04:33+09:00" level=info msg="WA...t."
Hint: Some lines were ellipsized, use -l to show in full.

Robie Basak (racb) wrote :

Believed fixed in Wily, but still affects Vivid.

Changed in docker.io (Ubuntu):
status: New → Fix Released
Kick In (kick-d) on 2015-06-26
description: updated
Kick In (kick-d) wrote :

Here is the diff for the docker.io.postinst between vivid and wily:
http://paste.ubuntu.com/11792608/

Martin Pitt (pitti) wrote :

Thanks @kick-d, this looks fine (as discussed on IRC).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers