Hi all,

I'm trying to use the technique here
https://medium.com/@felixge/killing-a-child-process-and-all-of-its-children-in-go-54079af94773

.. to ensure all children/grandchildren of my exec of /bin/bash die along
with it, but I am getting the above 'operation not permitted' error when
trying to Start(). It works fine without Setpgid set, but when my /bin/bash
dies, any background children spawned from it are left running, adopted by
init (pid 1).

Any idea why setting syscall.SysProcAttr{Setpgid: true} might not work
with  certain other attributes set? My program is a daemon running as root,
and sets Uid/Gid to another non-root user; it also uses github.com/kr/pty,
the Start() method of which also sets some other attributes, .Setctty and
.Setsid. I tried going through the golang stdlib startProcess() code and
related bits, but don't fully understand how all of these optional flags
interact.

Thanks,
-Russ

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAN4yCu-wxW6tfEcryOmkJUU6J3oVX6R3pHeOhpJFKsuReU%2BPhg%40mail.gmail.com.

Reply via email to