Code Monkey home page Code Monkey logo

Comments (8)

sepek avatar sepek commented on July 4, 2024 2

Stupid me confussed systemctl reload with systemctl daemon-reload and got confussed by the fact that there is no restart of docker itself.
Thanks for correcting me!

from ansible-role-docker.

sepek avatar sepek commented on July 4, 2024 1

For me that's still the case. My workaround is specifying all configuration paramaters in the daemon.json via:

docker_daemon_options:
  containerd: "/run/containerd/containerd.sock"
  hosts: [
    "tcp://127.0.0.1:2375",
    "unix:///var/run/docker.sock"
  ]

and the following systemd override via a pre_tasks for now:

pre_tasks:
  - name: Docker - override systemd service unit
    copy:
      dest: '/etc/systemd/system/docker.service.d/override.conf'
      content: |
        [Service]
        ExecStart=
        ExecStart=/usr/bin/dockerd

from ansible-role-docker.

epou avatar epou commented on July 4, 2024 1

thanks @sepek for your solution. I've added some more lines into yours to make a little bit more generic and avoid some errors

pre_tasks: # see: https://github.com/geerlingguy/ansible-role-docker/issues/411
    - name: Docker - make sure systemd dir exists
      ansible.builtin.file:
        path: /etc/systemd/system/docker.service.d
        state: directory
        mode: '0755'
        owner: root
        group: root
    - name: Docker - override systemd service unit
      copy:
        dest: '/etc/systemd/system/docker.service.d/override.conf'
        content: |
          [Service]
          ExecStart=
          ExecStart=/usr/bin/dockerd
        mode: '0755'
        owner: root
        group: root
      register: systemd_changed
    - name: Just force systemd to reread configs
      ansible.builtin.systemd:
        daemon_reload: true
      when: systemd_changed.changed

hope it helps

from ansible-role-docker.

github-actions avatar github-actions commented on July 4, 2024

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

from ansible-role-docker.

sepek avatar sepek commented on July 4, 2024

@epou Nice thanks! I guess you would need a restart instead of a reload of Docker. Else I suspect the process would still be running with the default parameters.

from ansible-role-docker.

epou avatar epou commented on July 4, 2024

This is what I got without the systemctl daemon-reload

>>> sudo systemctl status docker.service
Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2023-10-05 13:37:10 UTC; 13s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 3095311 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 3095311 (code=exited, status=1/FAILURE)
        CPU: 32ms

Oct 05 13:37:08 hostname systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Oct 05 13:37:08 hostname systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 05 13:37:08 hostname systemd[1]: Failed to start Docker Application Container Engine.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 05 13:37:10 hostname systemd[1]: Stopped Docker Application Container Engine.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Start request repeated too quickly.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 05 13:37:10 hostname systemd[1]: Failed to start Docker Application Container Engine.

So I saw the -> Run 'systemctl daemon-reload' to reload units.

So then:

>>> sudo systemctl daemon-reload
>>> sudo systemctl start docker.service
>>> sudo systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/docker.service.d
             └─override.conf
     Active: active (running) since Thu 2023-10-05 13:38:00 UTC; 1s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 3095351 (dockerd)
      Tasks: 10
     Memory: 34.0M
        CPU: 203ms
     CGroup: /system.slice/docker.service
             └─3095351 /usr/bin/dockerd

It can be seen that the override is done well.

from ansible-role-docker.

github-actions avatar github-actions commented on July 4, 2024

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

from ansible-role-docker.

github-actions avatar github-actions commented on July 4, 2024

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

from ansible-role-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.