diff --git a/cmd/docker-gen/main.go b/cmd/docker-gen/main.go index 612dc895..c7d96b16 100644 --- a/cmd/docker-gen/main.go +++ b/cmd/docker-gen/main.go @@ -24,6 +24,7 @@ var ( wait string notifyCmd string notifyOutput bool + sighupContainerID string notifyContainerID string notifyContainerSignal int onlyExposed bool @@ -96,7 +97,7 @@ func initFlags() { flag.BoolVar(&includeStopped, "include-stopped", false, "include stopped containers") flag.BoolVar(¬ifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command") flag.StringVar(¬ifyCmd, "notify", "", "run command after template is regenerated (e.g `restart xyz`)") - flag.StringVar(¬ifyContainerID, "notify-sighup", "", + flag.StringVar(&sighupContainerID, "notify-sighup", "", "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`") flag.StringVar(¬ifyContainerID, "notify-container", "", "container to send a signal to") @@ -158,6 +159,9 @@ func main() { Interval: interval, KeepBlankLines: keepBlankLines, } + if sighupContainerID != "" { + cfg.NotifyContainers[sighupContainerID] = int(syscall.SIGHUP) + } if notifyContainerID != "" { cfg.NotifyContainers[notifyContainerID] = notifyContainerSignal }