go - golang handling kill in a process started by cmd.Start -
i have 2 go programs. proga starts progb using cmd.start(). proga try kill progb, progb should killed immediately, has cleanup before dying. i'm using signal.notify in progb handle sigcall.sigkill whenever proga calls progb.process.kill() doesn't seem notify progb(write contents sigc channel)
in progb have notify this:
signal.notify(sigc, syscall.sigkill) go func() { fmt.println("started listening") <-sigc fmt.println("sig term") cleanup() os.exit(1) }() somelongrunningcode()
is there i'm missing out? i'm sure proga sends sigkill because cmd.process.kill() internally process.signal(sigkill)
sigkill cannot trapped recieving process - kernel force process termination. may send sigterm process , handle on other side - conventional method stop application.
Comments
Post a Comment