Is there a timeout for init.d scripts running during boot process?

I am creating a few scripts that are being registered to execute on server start on CentOS 6.5.

One of this scripts has a while loop that blocks until it finds a successful start message on the log of another process that is also being started during boot(init.d).

If this service that my script has a dependency on, never logs the successful start to its log file and my script hangs on the while loop forever, will this specific scenario make the operating system completely hang and never start? Is there a timeout setting for init.d scripts?

My scripts are registered to executed on the rc.local file.


Solution 1:

If an init.d script doesn't terminate, the normal system start-up will be interrupted indefinitely.

One common solution is to incorporate a counter in the while loop and exit with an error message after a given number of while loops. If you're waiting for an external command that doesn't have a timeout option, have a look at this question.