9 Commits
Author SHA1 Message Date
Paweł Gronowski 699057d8b8 daemon/command: Refuse containerd migration with userns-remap
The containerd image store is not supported with userns-remap, so the
daemon disables the containerd-snapshotter feature and refuses to start
when it is explicitly enabled.
The containerd-migration feature was not covered by this, so a daemon
with both userns-remap and containerd-migration still switched to the
containerd image store.

Refuse to start in that case too, with the same kind of error as for
containerd-snapshotter.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-11-05 17:33:39 +01:00
Cory SniderandSebastiaan van Stijn 40f06bf418 Reapply: daemon/command: add support for sd_notify "reload" notifications
This reapplies the af18206 commit which was reverted by ddb636c.

commit f74b856e1a added an [ExecReload] to
the systemd unit, which allows users to signal the daemon to reload its
config through systemd (`systemctl reload docker.service`).

While reloading works, systemd expects the `ExecReload` command to be
synchronous, so that it knows when the reload completes, and can account
for this when managing dependent services.

> Note however that reloading a daemon by enqueuing a signal (...) is usually
> not a good choice, because this is an asynchronous operation and hence not
> suitable when ordering reloads of multiple services against each other.

Systemd 253 introduced a new Type (Type=notify-reload, see [systemd#25916]),
which allows setting a "ReloadSignal" instead, if the service supports
it by including a [MONOTONIC_USEC] value in its "RELOADING=1"
notifications.

This patch:

- adds reload notifications to the daemon to notify when the daemon got
  signaled to reload its configuration see [sd_notify(3)].
- appends a [MONOTONIC_USEC] value to the reload notification to support
  systemd 253's notify-reload protocol. This is backwards-compatible
  with older systemd releases as the systemd service manager ignores
  unknown assignments in notifications.
- adds a `notifyReady` callback to notify when the reload finished,
  which we currently send regardless if the reload was successful or
  failed (which could be due to an invalid config).

[ExecReload]: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecReload=
[systemd#25916]: https://github.com/systemd/systemd/pull/25916
[MONOTONIC_USEC]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#MONOTONIC_USEC=…
[sd_notify(3)]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#RELOADING=1

Signed-off-by: Cory Snider <csnider@mirantis.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-26 12:08:46 +01:00
Paweł Gronowski c6ca7d49f9 Revert "daemon/command: don't make notifyReady(), notifyStopping() asynchronous"
This reverts commit 236fc46b5a.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-13 13:05:09 +01:00
Paweł Gronowski ddb636c2bd Revert "daemon/command: add support for sd_notify "reload" notifications"
This reverts commit af18206630.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-13 13:05:06 +01:00
Cory SniderandSebastiaan van Stijn af18206630 daemon/command: add support for sd_notify "reload" notifications
commit f74b856e1a added an [ExecReload] to
the systemd unit, which allows users to signal the daemon to reload its
config through systemd (`systemctl reload docker.service`).

While reloading works, systemd expects the `ExecReload` command to be
synchronous, so that it knows when the reload completes, and can account
for this when managing dependent services.

> Note however that reloading a daemon by enqueuing a signal (...) is usually
> not a good choice, because this is an asynchronous operation and hence not
> suitable when ordering reloads of multiple services against each other.

Systemd 253 introduced a new Type (Type=notify-reload, see [systemd#25916]),
which allows setting a "ReloadSignal" instead, if the service supports
it by including a [MONOTONIC_USEC] value in its "RELOADING=1"
notifications.

This patch:

- adds reload notifications to the daemon to notify when the daemon got
  signaled to reload its configuration see [sd_notify(3)].
- appends a [MONOTONIC_USEC] value to the reload notification to support
  systemd 253's notify-reload protocol. This is backwards-compatible
  with older systemd releases as the systemd service manager ignores
  unknown assignments in notifications.
- adds a `notifyReady` callback to notify when the reload finished,
  which we currently send regardless if the reload was successful or
  failed (which could be due to an invalid config).

[ExecReload]: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecReload=
[systemd#25916]: https://github.com/systemd/systemd/pull/25916
[MONOTONIC_USEC]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#MONOTONIC_USEC=…
[sd_notify(3)]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#RELOADING=1

Signed-off-by: Cory Snider <csnider@mirantis.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-03 12:25:25 -05:00
Sebastiaan van Stijn 236fc46b5a daemon/command: don't make notifyReady(), notifyStopping() asynchronous
Leave it to the consumer to decide whether these should be called in a
goroutine.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-03 12:24:08 -05:00
Albin Kerouanton e1722eb8d8 daemon/command: disable c8d snapshotter when userns remapping enabled
Buildkit fails when userns remapping is enabled and c8d snapshotter is
used. As a temporary workaround, disable c8d snapshotter when userns
remapping is enabled. This will need a proper fix in the future.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-10-14 10:14:35 +02:00
Derek McGowan f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Derek McGowan 33139da522 Split part of dockerd main to command under daemon
Allows using daemon/internal packages when creating dockerd

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-23 14:45:03 -07:00