bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

Feature request: --json-status-fd could provide pid of command?

Open teleclimber opened this issue 3 years ago • 4 comments

--json-status-fd gives a child-pid value, which is handy. In a lot of situations that is the pid of the COMMAND you're running in the sandbox.

But when run with --unshare-pid (and maybe others) bwrap forks itself and child-pid references the fork. I would like a way of getting the pid of the COMMAND. Could this be added to the JSON output?

Thanks.

teleclimber avatar Feb 09 '23 22:02 teleclimber

If this is achievable, I'd be happy to review a pull request. The easiest way to work out whether this is achievable or not would be to try to implement it and see what happens.

smcv avatar Feb 23 '23 12:02 smcv

A use case example: you might want to send SIGTERM to give your program a chance to terminate gracefully. However, child-pid is wrong pid to send signals to when bwrap runs pid 1.

WGH- avatar Apr 17 '23 21:04 WGH-

I think we'll need this to fix this WebKit bug.

If this is achievable, I'd be happy to review a pull request. The easiest way to work out whether this is achievable or not would be to try to implement it and see what happens.

See #576 (and thank you!).

mcatanzaro avatar Jun 10 '24 17:06 mcatanzaro