Files
moby/cmd/dockerd/main.go
Sebastiaan van Stijn 0678de9c87 cmd/dockerd: main(): remove "onError" func
Remove the redundant abstraction; just inline it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 15:52:35 +01:00

40 lines
802 B
Go

package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/moby/sys/reexec"
"github.com/moby/term"
"github.com/moby/moby/v2/daemon/command"
)
func main() {
if reexec.Init() {
return
}
ctx := context.Background()
// Ignore SIGPIPE events. These are generated by systemd when journald is restarted while
// the docker daemon is not restarted and also running under systemd.
// Fixes https://github.com/moby/moby/issues/19728
signal.Ignore(syscall.SIGPIPE)
// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()
r, err := command.NewDaemonRunner(stdout, stderr)
if err != nil {
_, _ = fmt.Fprintln(stderr, err)
os.Exit(1)
}
if err := r.Run(ctx); err != nil {
_, _ = fmt.Fprintln(stderr, err)
os.Exit(1)
}
}