Its not clear to me if you are wanting to manipulation the ownership group 
or the process group.

The ownership group is usually modified in the shell with chgrp. From a 
program, you could
change it with https://pkg.go.dev/os#Chown

If you want a new process to have its own process group, you can do 
something like this in Go:

cmd := exec.Command(path, args...)

c.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}

See https://pkg.go.dev/syscall#SysProcAttr and the Setpgid doc there




On Sunday, August 11, 2024 at 4:01:20 AM UTC+1 LiteLotus wrote:

i want to do something similar to docker, where the application im making 
executes as its own user, and the user interacting with it should be in the 
same group as the application, whats the best method to do this in go?


-- 
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/33a008b3-4688-4aa0-946e-37314589742an%40googlegroups.com.

Reply via email to