I have two processes: a server that should be run in background, but starts serving requests after a delay, and a client that should be started when server is ready. The server prints line containg "Acceptin connections" to its stderr when ready (server stderr is redirected to a file when running it in background).
How to delay putting server process in background until server is ready to serve requests? Alternatively, how to delay running client until server is ready?
Language: shell script (or optionally Perl).
Added 2010-05-19 22:34 +0000:
It is known upfront which TCP port the server would listen to for requests.
Note: server is web server (plackup running HTTP::Server::PSGI), client is web browser, e.g. lynx.