Skip to content

Commit 6169bf3

Browse files
authored
Merge pull request #620 from nginx-proxy/notify-sighup
fix: -notify-sighup should not use signal from -notify-signal
2 parents c10343f + 49e64f5 commit 6169bf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/docker-gen/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var (
2424
wait string
2525
notifyCmd string
2626
notifyOutput bool
27+
sighupContainerID string
2728
notifyContainerID string
2829
notifyContainerSignal int
2930
onlyExposed bool
@@ -96,7 +97,7 @@ func initFlags() {
9697
flag.BoolVar(&includeStopped, "include-stopped", false, "include stopped containers")
9798
flag.BoolVar(&notifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command")
9899
flag.StringVar(&notifyCmd, "notify", "", "run command after template is regenerated (e.g `restart xyz`)")
99-
flag.StringVar(&notifyContainerID, "notify-sighup", "",
100+
flag.StringVar(&sighupContainerID, "notify-sighup", "",
100101
"send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`")
101102
flag.StringVar(&notifyContainerID, "notify-container", "",
102103
"container to send a signal to")
@@ -158,6 +159,9 @@ func main() {
158159
Interval: interval,
159160
KeepBlankLines: keepBlankLines,
160161
}
162+
if sighupContainerID != "" {
163+
cfg.NotifyContainers[sighupContainerID] = int(syscall.SIGHUP)
164+
}
161165
if notifyContainerID != "" {
162166
cfg.NotifyContainers[notifyContainerID] = notifyContainerSignal
163167
}

0 commit comments

Comments
 (0)