func handleSignals(controller libnetwork.NetworkController) { c := make(chan os.Signal, 1) signals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT} signal.Notify(c, signals...) go func() { for _ = range c { controller.Stop() os.Exit(0) } }() }