diff --git a/cmd/docker-gen/main.go b/cmd/docker-gen/main.go index e7a64c74..40e6e314 100644 --- a/cmd/docker-gen/main.go +++ b/cmd/docker-gen/main.go @@ -5,7 +5,9 @@ import ( "fmt" "log" "os" + "os/signal" "path/filepath" + "syscall" "github.com/BurntSushi/toml" docker "github.com/fsouza/go-dockerclient" @@ -113,6 +115,10 @@ func initFlags() { } func main() { + // SIGHUP is used to trigger generation but go programs call os.Exit(2) at default. + // Ignore the signal until the handler is registered: + signal.Ignore(syscall.SIGHUP) + initFlags() if version {