News for hackers. Stuff that matters.
Re:File Descriptor Transfer over Unix Domain Sockets by jitl on Monday November 02, 2020 @09:53AM (#24968708)
This can also be a handy technique when dealing with CLI tools that take a long time to boot/warm. Leave a zygote/server process running in the background that’s warmed, serving a UDS. When you want to invoke the tool, have a lightweight client connect to the server UDS and send argv, the env vars, cwd, and open file descriptors across the UDS to the zygote. The zygote forks, and the fork sets the env vars, argv, etc on itself and then runs the job.

The only problem with this is cancellation- you’ll need your client to propagate signals to to forked runner process, as well.

There are no comments on this comment yet.