Skip to content

Commit

Permalink
Merge pull request #1 from jterry75/multi_sig
Browse files Browse the repository at this point in the history
Add signal --key= override for multiple processes
  • Loading branch information
John Howard authored Nov 28, 2018
2 parents 12f7773 + 229b233 commit c240f60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker-signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ func PulseEvent(handle syscall.Handle) (err error) {

func main() {
var pid int
flag.IntVar(&pid, "pid", -1, "PID of docker daemon to signal to dump stacks")
var key string
flag.StringVar(&key, "key", "docker-daemon", "The 'key' override in 'Global\\key-pid'. docker=docker-daemon, containerd=containerd-daemon, conatinerd-runhcs-shim-v1=containerd-shim-runhcs-v1")
flag.IntVar(&pid, "pid", -1, "PID of process to signal to dump stacks")
flag.Parse()
if pid == -1 {
fmt.Println("Error: pid must be supplied")
return
}
ev := "Global\\docker-daemon-" + fmt.Sprint(pid)
ev := fmt.Sprintf("Global\\%s-%s", key, fmt.Sprint(pid))
h2, _ := OpenEvent(EVENT_MODIFY_STATUS, false, ev)
if h2 == 0 {
fmt.Printf("Could not open event. Check PID %d is correct and the daemon is running.\n", pid)
Expand Down

0 comments on commit c240f60

Please sign in to comment.