I have a program that I am writing a script for /etc/init.d.
The problem is that the program does not deconstruct itself . It takes 5 seconds to start it, and when it is initialized, it prints the line ("Start OK") to stdout.
I want to create a script that will start the process, wait for a while when the line appears, and then continue the script, indicating failure or success (the line is found).
Obviously this does not work as I want.
daemon $PROGRAM &
Instead
(./proc > some_output) &
poll_output_for "Started OK" 10 secs or die
source
share