On Tue, 14 Jan 2014, Michael Schnell wrote:
On 01/14/2014 11:32 AM, Michael Van Canneyt wrote:
#!/bin/bash
while [ 1 ]; do
yourprogram youroptions
done
I feel this will start multiple parallel copies of the program and not wait
until the previous one dies.
Of course it will wait.
A script always waits till a command exits.
Moreover I understand that this loop will never exit. Hence I can't use it an
init.d script, but in the calling script need to do something based on "bash
... &" to have the "respawn" script run in parallel.
I didn't suggest you'd use this as a init.d script.
In your init.d script you need launch the above script (call it loopmyprogram)
in the usual manner, in the background.
All this is IMHO preferable to modifying your program, which may introduce
additional bugs, unforeseen cases etc...
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal