rootlesskit icon indicating copy to clipboard operation
rootlesskit copied to clipboard

Pdeathsig

Open AkihiroSuda opened this issue 5 years ago • 0 comments

The usage of Pdeathsig in #66 isn't quite right. It will guarantee that the child dies, but it won't ensure that the parent doesn't accidentally kill the child. See https://github.com/golang/go/issues/27505 for details.

The correct way to use Pdeathsig would be to launch a goroutine, lock it to the OS thread, start the child in that goroutine, and don't exit the goroutine until the child exits. There's a more complete example in the issue I linked above.

FWIW, if you're launching lots of children, it might make sense to use a single goroutine locked to an OS thread to launch all of the potential children.

Originally posted by @virtuald in https://github.com/rootless-containers/rootlesskit/issues/65#issuecomment-713709507

AkihiroSuda avatar Oct 22 '20 03:10 AkihiroSuda