Re: mythbackend starting before mySQLd

"Christopher X. Candreva" <[email protected]>
Newsgroups gmane.linux.redhat.rpm.atrpms.general
Message-ID <[email protected]>
On Fri, 31 Aug 2012, The Walters wrote:

> I ran into this before and found where someone said just include a delay in the mythbackend startup script (edit
> /etc/rc.d/init.d/mythbackend and change/add: sleep ## <-- number of seconds 5 - 10 works), that has been working for me.
> 
> # daemon --user mythtv $binary $OPTIONS
>   daemon sleep 10; $binary $OPTIONS
> Hope this helps.

Rather than try to find the best sleep value, I added this bit of code 
before mythbackend actually starts:
#Wait for mysql to start, up to 60 seconds

for i in {1..60}
do
        if mysql -u mythtv -pPassword </dev/null >/dev/null 2>&1  ; then
                break
        fi
        sleep 1s;
done


So it checks once a second to see if it can connect, 60 times. It will wait 
up to a minute, then continue anyway -- and mythbackend will fail, but if it 
isn't up after a minute something is wrong.


==========================================================
Chris Candreva  -- [email protected] -- (914) 948-3162
WestNet Internet Services of Westchester
http://www.westnet.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.