containers/bubblewrap

enhancement: --daemonize-with-child option

jonleivent opened this issue · 0 comments

It would be nice if bwrap had a --daemonize-with-child option that daemonizes the outer bwrap when the first child process within bwrap daemonizes (exits but leaves other processes running). This would improve how well bwrap ... cmd... matches the behavior of cmd... with respect to its parent script. Obviously, --daemonize-with-child could not be paired with --as-pid-1.

Use case: I bwrap a server app that does some complex initialization, then daemonizes when it is ready to accept clients. This allows the parent script to delay client startup until the server is ready. Without --daeminize-with-child, I have to poll to determine when the server is ready, or use a wrapper script around the server that signals the parent script when the server daemonizes, or modify the server app to do some other kind of signalling.