|
24 | 24 | wait string
|
25 | 25 | notifyCmd string
|
26 | 26 | notifyOutput bool
|
27 |
| - notifySigHUPContainerID string |
| 27 | + notifyContainerID string |
| 28 | + notifyContainerSignal int |
28 | 29 | onlyExposed bool
|
29 | 30 | onlyPublished bool
|
30 | 31 | includeStopped bool
|
@@ -97,8 +98,9 @@ func initFlags() {
|
97 | 98 | flag.BoolVar(&includeStopped, "include-stopped", false, "include stopped containers")
|
98 | 99 | flag.BoolVar(¬ifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command")
|
99 | 100 | flag.StringVar(¬ifyCmd, "notify", "", "run command after template is regenerated (e.g `restart xyz`)")
|
100 |
| - flag.StringVar(¬ifySigHUPContainerID, "notify-sighup", "", |
101 |
| - "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`") |
| 101 | + flag.StringVar(¬ifyContainerID, "notify-sighup", "", "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`") |
| 102 | + flag.StringVar(¬ifyContainerID, "notify-container", "", "container to send a signal to") |
| 103 | + flag.IntVar(¬ifyContainerSignal, "notify-signal", int(docker.SIGHUP), "signal to send to the notify-container. Defaults to SIGHUP") |
102 | 104 | flag.Var(&configFiles, "config", "config files with template directives. Config files will be merged if this option is specified multiple times.")
|
103 | 105 | flag.IntVar(&interval, "interval", 0, "notify command interval (secs)")
|
104 | 106 | flag.BoolVar(&keepBlankLines, "keep-blank-lines", false, "keep blank lines in the output file")
|
@@ -155,8 +157,8 @@ func main() {
|
155 | 157 | Interval: interval,
|
156 | 158 | KeepBlankLines: keepBlankLines,
|
157 | 159 | }
|
158 |
| - if notifySigHUPContainerID != "" { |
159 |
| - config.NotifyContainers[notifySigHUPContainerID] = docker.SIGHUP |
| 160 | + if notifyContainerID != "" { |
| 161 | + config.NotifyContainers[notifyContainerID] = docker.Signal(notifyContainerSignal) |
160 | 162 | }
|
161 | 163 | configs = dockergen.ConfigFile{
|
162 | 164 | Config: []dockergen.Config{config}}
|
|
0 commit comments