[mythtv-users] Remote frontends can't connect following Mythbuntu update

Nick Rout nick.rout at gmail.com
Sun Jun 3 23:59:20 UTC 2012


On Mon, Jun 4, 2012 at 11:37 AM, Nick Rout <nick.rout at gmail.com> wrote:
> On Mon, Jun 4, 2012 at 11:25 AM, Nick Rout <nick.rout at gmail.com> wrote:
>> On Mon, Jun 4, 2012 at 6:27 AM, scram69 <scram69 at gmail.com> wrote:
>>> On Wed, May 23, 2012 at 11:20 PM, Martin Moores <moores.martin at gmail.com> wrote:
>>>> On May 24, 2012 5:16 AM, "scram69" <scram69 at gmail.com> wrote:
>>>>>
>>>>> Ran the update manager on my Mythbuntu 12.04 backend (I know, bad
>>>>> idea) last week, and discovered that remote frontends could no longer
>>>>> connect.
>>>>>
>>>>> Here's the frontend log message:
>>>>>
>>>>> 2012-05-20 19:48:53.809600 E  Unable to connect to database!
>>>>> 2012-05-20 19:48:53.809640 E  Driver error was [1/2003]:
>>>>> QMYSQL: Unable to connect
>>>>> Database error was:
>>>>> Can't connect to MySQL server on '192.168.1.50' (61)
>>>>>
>>>>> My backend has the static IP address above: I hadn't changed that or
>>>>> anything in the frontends' settings.
>>>>>
>>>>> I checked /etc/mythtv/mysql.txt and config.xml - nothing had changed.
>>>>> In desperation, I changed the mysql password for the mythtv user from
>>>>> the Mythbuntu random gibberish to "mythtv".  While that wreaked havoc
>>>>> with mythweb, it still did not fix the problem.
>>>>>
>>>>> What I finally discovered was that the update had edited an obscure
>>>>> file called /etc/mysql/conf.d/mythtv.cnf.  Inexplicably, it was
>>>>> changed from
>>>>>
>>>>> [mysqld]
>>>>> bind-address=0.0.0.0
>>>>>
>>>>> to
>>>>>
>>>>> [mysqld]
>>>>> #bind-address=0.0.0.0
>>>>>
>>>>> The net effect was that the mysql server no longer listened for
>>>>> frontends on the network, only for the local frontend.  Removing the
>>>>> "#" character solved the problem.
>>>>>
>>>>> I figured I'd post here in case anyone else had been screwed over by
>>>>> the update manger recently.  Any idea why the Mythbuntu update would
>>>>> mess around with mysql that way?
>>>>> _______________________________________________
>>>>> mythtv-users mailing list
>>>>> mythtv-users at mythtv.org
>>>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>>>
>>>> Same happened during my upgrade too! Thanks for posting though, this will
>>>> catch a lot of people out.
>>>>
>>>> Martin
>>>>
>>>>
>>>> _______________________________________________
>>>> mythtv-users mailing list
>>>> mythtv-users at mythtv.org
>>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>>>
>>>
>>> As a test of Mythbuntu, I ran update manager again today, and sure
>>> enough, the Mythbuntu update disables remote front ends.  I don't
>>> believe this is deliberate, so I'm wondering what I've got wrong in my
>>> configuration that would be causing this.  Is there another place
>>> where the mysql "bind address" gets set, so that this one can be
>>> commented out as necessary?
>>
>> If you run apt-get upgrade at the commandline,  are you given an
>> option to keep the original version of the file?
>
> mythtv-database is responsible for setting this. On 0.24 if you do
> dpkg-reconfigure mythtv-database you will be asked whether you want
> myth accessible from other machines, and the bind command is commented
> in or out as a result of your answer.
>
> On an update on 0.24 packages this seems to be left as it was before,
> so something must be screwy in the 0.25 packaging


Looking further the postinst script has changed (this script is run
after installing the package). In the past it said about line 111):

 #For database fillings
    #and mysql binding checks
    if [ -f "${MYSQLCONFIG}" ]; then
        db_get mythtv/public_bind
        if [ $RET = true ]; then
            NEWIP=`ifconfig | grep "inet addr:" | grep --invert-match
127.0.0.1 | sed ' s/inet addr://g; s/^[ \t]*//;s/[ \t]*$//; q;' | awk
'{print $1}'`
            sed -i -e 's/^#bind/bind/' ${MYSQLCONFIG}
        else
            sed -i -e 's/^bind/#bind/' ${MYSQLCONFIG}
        fi
    fi

It now says

    #For database fillings
    #and mysql binding checks
    if [ -f "${MYSQLCONFIG}" ]; then
        db_get mythtv/public_bind
        if [ -n "$RET" ] && [ $RET = true ]; then  #************************
            NEWIP=`ifconfig | grep "inet addr:" | grep --invert-match
127.0.0.1 | sed ' s/inet addr://g; s/^[ \t]*//;s/[ \t]*$//; q;' | awk
'{print $1}'`
            sed -i -e 's/^#bind/bind/' ${MYSQLCONFIG}
        else
            sed -i -e 's/^bind/#bind/' ${MYSQLCONFIG}
        fi
    fi


I have marked the line that has changed, I am no expert in bash
conditions or the functions in a deb postinst, but this is in the bit
where it sets bind address, so is likely the culprit.

The earlier version is the same in my recent 0.24 packages, and in the
package released with precise
mythtv-database_0.25.0+fixes.20120410.1f5962a-0ubuntu1_all.deb

It has changed by
mythtv-database_0.25.0+fixes.20120603.eec0c74-0ubuntu0mythbuntu5_all.deb

I guess the answer to why this was changed may be on launchpad. That's
where I'll look next.


More information about the mythtv-users mailing list