How to delay putting process in background until after it is ready to serve, in shell

Posted by Jakub Narebski on Stack Overflow See other posts from Stack Overflow or by Jakub Narebski
Published on 2010-05-19T21:38:05Z Indexed on 2010/05/19 21:40 UTC
Read the original article Hit count: 300

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).

© Stack Overflow or respective owner

Related posts about shell

Related posts about shell-scripting