FAQ
It depends on your exact use case and platform how you should arrange things.

If using process groups, first it is necessary to arrange your process
so that it is in a process group, which in Linux you can do in general
by invoking a program under setsid(1).

Then to signal that process group you signal the negative PID of the
process invoked under setsid, which is the process group ID. (i.e, if
it has PID 1234, "-1234" is the process group ID)

If writing go code which invokes other programs and the go program is
responsible for signalling to those processes and all of their
children, then you have to do a bit more when using os.Exec.

You can set the SysProcAttr.Setsid to True on the process and then it
will be a session leader with a new process group associated with it.
The go code can then signal the negative of the `*Command`'s PID and
that child and all sub-processes will be signalled.


On 30 July 2014 11:16, Tamás Gulácsi wrote:
How to kill a process group? Noe I'm using "kill -p pid"...

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 8 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 29, '14 at 1:44p
activeJul 30, '14 at 12:29p
posts8
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase