in reply to Persist shell app

Alternatively, you could create a wrapper for the unix application that runs in the background. Your CGI program would then simply forward requests to the unix application via the wrapper, using a unix domain socket, named pipe, or other such bi-directional IPC mechanism, and the wrapper would forward back any replies over the same IPC channel.

Black flowers blossom
Fearless on my breath