Paweł Gronowski
1200f5e45c
daemon: Fix panic in shutdown after daemon init fails
When error during daemon initialization fails before the events manager
is created the daemon will panic instead of erroring out cleanly with
an actual error message.
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x194fcec]
goroutine 1 [running, locked to thread]:
github.com/moby/moby/v2/daemon/events.(*Events).Close(...)
/go/src/github.com/docker/docker/daemon/events/events.go:157
github.com/moby/moby/v2/daemon.(*Daemon).Shutdown(0x40001bf908, {0x2d664f0, 0x44c87e0})
/go/src/github.com/docker/docker/daemon/daemon.go:1505 +0x3bc
github.com/moby/moby/v2/daemon.NewDaemon.func1()
/go/src/github.com/docker/docker/daemon/daemon.go:907 +0x44
github.com/moby/moby/v2/daemon.NewDaemon({0x2d66560, 0x4000051c20}, 0x40004a6108, 0x40006fe810, 0x4000318700)
/go/src/github.com/docker/docker/daemon/daemon.go:1371 +0x2130
github.com/moby/moby/v2/daemon/command.(*daemonCLI).start(0x4000051bd0, {0x2d664f0, 0x44c87e0})
/go/src/github.com/docker/docker/daemon/command/daemon.go:264 +0xb90
github.com/moby/moby/v2/daemon/command.runDaemon(...)
/go/src/github.com/docker/docker/daemon/command/docker_unix.go:13
github.com/moby/moby/v2/daemon/command.newDaemonCommand.func1(0x4000381808, {0x40006ac780?, 0x7?, 0x287f0b1?})
/go/src/github.com/docker/docker/daemon/command/docker.go:48 +0xb0
github.com/spf13/cobra.(*Command).execute(0x4000381808, {0x4000050060, 0x4, 0x4})
/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1015 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x4000381808)
/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1064
github.com/moby/moby/v2/daemon/command.daemonRunner.Run({0x2d35440?}, {0x2d664f0, 0x44c87e0})
/go/src/github.com/docker/docker/daemon/command/docker.go:97 +0x6c
main.main()
/go/src/github.com/docker/docker/cmd/dockerd/main.go:35 +0x108
```
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-01-27 11:55:03 +01:00
..
2026-01-24 17:16:05 +01:00
2026-01-05 12:42:49 +01:00
2026-01-26 16:51:41 +01:00
2025-12-15 18:56:34 +01:00
2025-12-15 18:56:34 +01:00
2026-01-26 17:08:02 +00:00
2026-01-27 11:55:03 +01:00
2025-12-19 17:51:03 +01:00
2025-12-15 18:56:33 +01:00
2025-05-30 15:59:13 +02:00
2026-01-24 17:16:05 +01:00
2026-01-24 17:16:05 +01:00
2025-12-15 18:56:33 +01:00
2025-07-31 10:13:29 -07:00
2026-01-16 16:22:03 +05:30
2025-07-31 10:13:29 -07:00
2025-10-30 17:11:38 -04:00
2026-01-26 16:51:48 +01:00
2026-01-26 17:08:02 +00:00
2025-07-31 10:13:29 -07:00
2025-10-27 16:39:32 +01:00
2025-04-07 16:19:02 +02:00
2026-01-21 12:20:30 +01:00
2025-05-30 15:59:13 +02:00
2025-07-22 18:48:39 +02:00
2025-07-31 10:13:29 -07:00
2025-07-13 16:37:36 +02:00
2025-07-31 10:13:29 -07:00
2025-12-19 17:51:03 +01:00
2025-07-31 10:13:29 -07:00
2025-10-09 20:13:26 -04:00
2025-07-31 10:13:29 -07:00
2025-07-21 09:30:05 -07:00
2025-12-02 02:30:14 +09:00
2025-09-19 16:02:14 +02:00
2025-09-05 10:20:06 +02:00
2025-09-11 15:25:14 -04:00
2025-12-15 18:56:33 +01:00
2025-07-21 09:30:05 -07:00
2025-07-31 10:13:29 -07:00
2025-11-24 14:14:27 +00:00
2025-10-03 21:39:14 +02:00
2025-08-08 17:07:07 +02:00
2026-01-19 13:43:06 +01:00
2025-10-03 17:30:42 -05:00
2025-07-31 10:13:29 -07:00
2025-12-11 11:07:42 +01:00
2025-07-29 11:16:25 +02:00
2025-08-08 19:19:21 +02:00
2025-04-22 11:31:10 +02:00
2025-11-16 18:25:42 +00:00
2025-11-16 18:25:42 +00:00
2025-12-10 10:30:44 +00:00
2025-09-08 10:08:35 +02:00
2025-12-15 18:56:34 +01:00
2025-12-11 11:07:42 +01:00
2025-10-25 16:13:30 +02:00
2025-12-18 19:55:56 +01:00
2025-08-08 17:07:07 +02:00
2025-05-30 15:59:13 +02:00
2025-11-16 18:20:12 +00:00
2026-01-24 17:16:05 +01:00
2025-07-31 10:13:29 -07:00
2025-05-30 15:59:13 +02:00
2025-07-31 10:13:29 -07:00
2025-09-19 15:33:36 +01:00
2025-11-10 16:08:12 +01:00
2025-05-30 15:59:13 +02:00
2026-01-20 13:53:12 +01:00
2026-01-20 13:53:12 +01:00
2026-01-19 14:10:12 +01:00
2025-11-13 20:52:15 +01:00
2026-01-19 13:43:06 +01:00
2025-08-08 17:07:07 +02:00
2026-01-05 12:42:49 +01:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-09-19 16:02:14 +02:00
2025-12-19 17:51:03 +01:00
2025-09-19 15:33:36 +01:00
2025-11-10 16:08:15 +01:00
2025-11-12 07:53:46 -08:00
2025-11-12 07:53:46 -08:00
2025-05-30 15:59:13 +02:00
2025-11-13 20:52:15 +01:00
2025-11-13 10:05:49 +01:00
2025-11-13 10:05:49 +01:00
2025-05-30 15:59:13 +02:00
2025-12-15 18:56:34 +01:00
2025-10-31 02:09:38 +01:00
2025-12-15 10:36:05 +00:00
2025-08-26 20:18:57 +02:00
2025-10-21 09:15:18 +02:00
2025-08-26 20:18:57 +02:00
2025-12-15 18:56:33 +01:00
2025-05-30 15:59:13 +02:00
2025-05-30 15:59:13 +02:00
2025-09-19 16:02:14 +02:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-12-15 18:56:34 +01:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-12-15 18:56:34 +01:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-21 09:30:05 -07:00
2025-09-19 16:02:14 +02:00
2025-07-31 10:13:29 -07:00
2025-10-05 13:41:22 +02:00
2025-11-10 16:08:12 +01:00
2025-09-19 16:02:14 +02:00
2025-12-15 18:56:34 +01:00
2025-10-03 21:39:14 +02:00
2025-07-31 10:13:29 -07:00
2025-12-15 18:56:34 +01:00
2025-12-16 13:31:33 +01:00
2025-12-16 13:31:33 +01:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-10-05 13:41:22 +02:00
2025-10-25 16:13:30 +02:00
2025-11-05 15:48:02 +01:00
2025-12-15 18:56:34 +01:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-12-15 13:59:09 +00:00
2025-10-29 18:42:36 +01:00
2025-09-25 22:53:48 +02:00
2025-07-31 10:13:29 -07:00
2025-09-19 16:02:14 +02:00
2025-08-08 17:07:07 +02:00
2025-08-08 17:07:07 +02:00
2025-08-08 17:07:07 +02:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-21 09:30:05 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-09-19 16:02:14 +02:00
2025-08-08 21:41:17 +02:00
2025-09-19 15:33:36 +01:00
2025-07-31 10:13:29 -07:00
2025-05-16 10:23:49 -04:00
2026-01-24 17:16:05 +01:00
2025-10-27 16:39:32 +01:00
2025-10-27 16:39:32 +01:00
2025-09-19 16:02:14 +02:00
2025-05-30 15:59:13 +02:00
2025-09-19 16:02:14 +02:00
2025-09-19 16:02:14 +02:00
2025-09-19 16:02:14 +02:00
2025-07-21 09:30:05 -07:00
2025-09-16 13:08:36 +02:00
2025-07-31 10:13:29 -07:00
2025-09-19 16:02:14 +02:00
2025-07-21 09:30:05 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2025-07-31 10:13:29 -07:00
2026-01-21 16:36:05 +01:00
2025-09-19 16:02:14 +02:00
2025-08-01 01:48:55 +02:00