"Завершая мусор, игнорируя."Ошибка для Docker при использовании puppet in centos на бродячей виртуальной коробке - PullRequest
0 голосов
/ 14 октября 2019

Когда я пытаюсь установить докер на Centos 7 с помощью модуля кукольного докера, используя этот модуль кукол https://forge.puppet.com/puppetlabs/docker

  # Install Docker
  class { 'docker':
    version => '18.06.1.ce-3.el7',
  }

Я использую vagrant, virutalbox и следующий блок Centos

   config.vm.box = "geerlingguy/centos7"
   config.vm.box_version = "1.2.15"

В первый раз все работает нормально, но снова в поле предоставления

$ vagrant provsion --color

Получает эту ошибку, есть идеи, как ее исправить?

==> default: Info: /Stage[main]/Docker::Service/Exec[docker-systemd-reload-before-service]: Scheduling refresh of Service[docker]
==> default: Error: Systemd start for docker failed!
==> default: journalctl log for docker:
==> default: -- Logs begin at Mon 2019-10-14 15:41:55 NZDT, end at Mon 2019-10-14 15:43:14 NZDT. --
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default:
==> default: Error: /Stage[main]/Docker::Service/Service[docker]/ensure: change from 'stopped' to 'running' failed: Systemd start for docker failed!
==> default: journalctl log for docker:
==> default: -- Logs begin at Mon 2019-10-14 15:41:55 NZDT, end at Mon 2019-10-14 15:43:14 NZDT. --
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
==> default: Oct 14 15:43:14 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
==> default:
==> default: Notice: /Stage[main]/Docker::Service/Service[docker]: Triggered 'refresh' from 1 event

Существуют различные ссылки, связанные с похожей проблемой, ноникто не был действительно связан с этой ошибкой https://github.com/docker/for-linux/issues/162

https://github.com/moby/moby/issues/34091

https://github.com/coreos/fleet/issues/992

Обновление

[vagrant@docker ~]$ sudo systemctl daemon-reload
[vagrant@docker ~]$ sudo systemctl start docker
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.
[vagrant@docker ~]$ sudo systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: error (Reason: Invalid argument)
  Drop-In: /etc/systemd/system/docker.service.d
           └─service-overrides.conf
   Active: inactive (dead)
     Docs: https://docs.docker.com

Oct 16 11:54:25 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
Oct 16 11:57:05 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
Oct 16 11:57:05 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
Oct 16 11:57:05 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
Oct 16 11:57:21 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
Oct 16 11:57:21 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
Oct 16 11:57:21 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
Oct 16 11:57:32 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:6] Trailing garbage, ignoring.
Oct 16 11:57:32 docker systemd[1]: [/etc/systemd/system/docker.service.d/service-overrides.conf:7] Missing '='.
Oct 16 11:57:32 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.
[vagrant@docker ~]$ 

1 Ответ

1 голос
/ 14 октября 2019

На основании вашего сообщения об ошибке

==> default: Oct 14 15:43:14 docker systemd[1]: docker.service lacks both ExecStart= and ExecStop= setting. Refusing.

создается впечатление, что в файле docker.service отсутствуют несколько строк, которые имеют решающее значение для запуска и управления службой.

Вы можете проверитьрабочий пример от docker здесь:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket

[Service]
Type=notify
# 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://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

https://github.com/moby/moby/blob/master/contrib/init/systemd/docker.service

Вы можете определить, где находится файл службы в вашей системе, с помощью

sudo systemctl status docker
    docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

. Как вы можете видетьв приведенном выше примере служебный файл находится в /usr/lib/systemd/system/docker.service.

...