You need to tell us the OS you are using as well as the Go version. Beyond that you should be able to provide a minimal reproduction program for an issue of this sort.
Beyond the above, please note that in general you can't achieve what you're trying to do. The `setpgid()` syscall that the feature you are trying to use maps to can fail for several reasons. See `man setpgid`. Also, the error message you mention is typically associated with errno value EPERM. Depending on your OS there will be one or more reasons for that error. On Wed, Aug 7, 2019 at 8:55 PM Russtopia <rma...@gmail.com> wrote: > 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 > <https://groups.google.com/d/msgid/golang-nuts/CAN4yCu-wxW6tfEcryOmkJUU6J3oVX6R3pHeOhpJFKsuReU%2BPhg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- 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/CABx2%3DD_WDcCmAQHBsO1-RUYRMmdVSwuWwYvTFFKGu9mbghQ_vA%40mail.gmail.com.