Re: mythbackend fails to start on boot; mysqld not ready

Chris Schanzle <[email protected]> Wed, 16 May 2012 23:00:15 -0400
Newsgroups gmane.linux.redhat.rpm.atrpms.devel
Message-ID <[email protected]>
On 05/11/2012 11:38 AM, George Galt wrote:
> On Thu, Mar 29, 2012 at 8:42 AM, Chris Schanzle<[email protected]>  wrote:
>> I would say about 25% of the time, mythbackend doesn't start on my Fedora 16
>> box on reboot.  From the logs, it appears the local mysqld is not ready to
>> accept connections.  Unfortunately, it doesn't try to reconnect and the
>> result is missed recordings and a non-functional frontend.  Restarting
>> mythbackend (service mythbackend restart) is the band-aid.
>>
>> Is there some improvement we can make to the initscript to ensure we can
>> talk to the sql server?  I realize it might not be local on the box, so we
>> can't just depend on the mysqld service.
>>
>> Note mysqld is a systemd service while mythbackend is a SysV service (init.d
>> script).
>>
>> I'd take a stab at a fix, but would appreciate any guidance on the best
>> direction to head.
>>
>> Thanks!
>>
>> _______________________________________________
>> atrpms-devel mailing list
>> [email protected]
>> http://lists.atrpms.net/mailman/listinfo/atrpms-devel
>
> Chris:
>
> Any luck on developing something that works here?  I've noticed others
> are also having this issue and I'll probably take a look at it this
> weekend, but if you've made a headstart, please let me know.


I poked at it back in April but a mythtv update overwrote my mods, didn't get any response, so I presumed it was just me.  My mysqldb is quite large (/var/lib/mysql/mythconverge = 222MB) so I can imagine MySQL might take a few seconds to become ready.

Putting a few more thoughts into it, I don't think this could/should be fixed with initscripts, but rather is a bug in mythbackend which should attempt to connect to the configured db until success, not just fail once and fall over.

 From /var/log/boot.log, MySQL is starting before the mythbackend SYSV script, so that's good.

At this point, I'd take hack of a 'sleep 10' delay to the start() section of /etc/init.d/mythbackend and run with it until a real fix is implemented.  :-)

Chris