[mythtv-users] One step forward, two steps back - Frontends not woring properly

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Apr 30 18:13:43 UTC 2016


On Sat, 30 Apr 2016 16:35:39 +0100, you wrote:

>On 30/04/2016 07:43, Stephen Worthington wrote:
>
>> On Sat, 30 Apr 2016 01:14:35 +0100, you wrote:
>>
>>> On 30/04/2016 00:26, Mark Perkins wrote:
>>>>> On 29/04/2016 23:13, Damian wrote:
>>>>>
>>>>>> On 29/04/2016 23:09, Thomas Mashos wrote:
>>>>>>
>>>> ...snip...
>>>>>> On your backend, is mysql listening on the right addresses?
>>>>>> -- 
>>>>>> Thomas Mashos
>>>>> Hi Thomas,
>>>>>
>>>>> I can log in with ...
>>>>> mysql -u mythtv -p -h 192.168.0.2
>>>>>
>>>>> Does that answer your question? If it doesn't, I'm afraid I don't understand the question well enough. Is there a command that I should run to test it?
>>>>>
>>>>> Thanks,
>>>>> Damian
>>>> To check whether mysql is listening on the right address run this command as root user
>>>> netstat -tulpn | grep 3306
>>> Hi Mark,
>>>
>>> Here's the output from that:
>>>
>>> $ netstat -tulpn | grep 3306
>>> (Not all processes could be identified, non-owned process info
>>>   will not be shown, you would have to be root to see it all.)
>>> tcp6       0      0 :::3306                 :::* LISTEN      -
>>>
>>> and with sudo ...
>>>
>>> sudo netstat -tulpn | grep 3306
>>> tcp6       0      0 :::3306                 :::* LISTEN      819/mysqld
>>>
>>> I'm guessing, from your comments regarding IP addresses, that this isn't
>>> right? There are no ip addresses there.
>>>
>>> Should I post the output of ifcongig, or would that be a stupid security
>>> risk to post publicly?
>>>
>>>> And post results. If it returns the proper IP address (assuming your machine has been given a proper IP address) of your machine it should be ok but if it returns 127.0.0.1 then it is only listening on the local machine. In which case find your mysqld.cnf file probably /etc/mysql/mysql.conf.d/mysqld.cnf and comment out the line that says bind-address = 127.0.0.1. Recent thread here - http://www.gossamer-threads.com/lists/mythtv/users/58782
>>> That line is already commented out in that file.
>>>> If it returns nothing then mysql is probably not running. Check its running
>>>> systemctl status mysql
>>> $ systemctl status mysql
>>> ? mysql.service - MySQL Community Server
>>>     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor
>>> preset: enabled)
>>>     Active: active (running) since Fri 2016-04-29 23:03:24 BST; 2h 3min ago
>>>    Process: 820 ExecStartPost=/usr/share/mysql/mysql-systemd-start post
>>> (code=exited, status=0/SUCCESS)
>>>    Process: 802 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
>>> (code=exited, status=0/SUCCESS)
>>>   Main PID: 819 (mysqld)
>>>      Tasks: 48 (limit: 512)
>>>     CGroup: /system.slice/mysql.service
>>>             ??819 /usr/sbin/mysqld
>>>
>>> Apr 29 23:03:04 gingerserver systemd[1]: Starting MySQL Community Server...
>>> Apr 29 23:03:24 gingerserver systemd[1]: Started MySQL Community Server.
>>>
>>>> I think, I don’t run Mythbuntu.
>>>>
>>>> I'm going to guess based on recent posts that it's not running and has errors like:
>>>> [ERROR] unknown variable 'table_cache=128'
>>>>
>>>> In which case edit /etc/mysql/conf.d/mythtv-tweaks.cnf and replace the line
>>>> table_cache=128
>>>>
>>>> with
>>>> table_open_cache=128
>>>>
>>>> or else just comment out the line entirely. Info here - https://bugs.launchpad.net/mythbuntu/+bug/1575864
>>> I came across that one earlier. That's already hashed out.
>>>
>>> What's next? :-)
>>>
>>> Thanks,
>>> Damian
>> How is your backend box getting its IPv4 address?  If it is by DHCP,
>> then it is likely that the box will have configured IPv6 before IPv4
>> and the backend may be starting before the IPv4 address is available.
>> I always recommend that server boxes (such as mythbackend) should have
>> static IP address assignments.
>I have static IP's set up by assigning IP addresses for each machine, in 
>my router settings.

That is not static.  It is still by DHCP, which is what causes the
problem as it takes quite a while to get an IP address from the router
with DHCP packets, compared to how long it takes for a box to get an
IPv6 address.  A static address is assigned on the box itself, and
requires no network traffic to set it up so it comes up as soon as the
ethernet card does.

>> In any case, I think a brute force fix would be to go into the
>> settings in mysql and MythTV and put in your IPv4 address
>> (192.168.0.2).  So that would be the bind-address= setting for mysql,
>> in mythtv-setup, and also in all the config.xml files in /etc/mythtv
>> and /home/<mythtv-user>/.mythtv on all machines.  That should make
>> everything talk in the same way.
>I think I already have 192.168.0.2 in all of the config.xml files on 
>every machine. What else do I need to do?

Change the bind-address= setting in the /etc/mysql config files to
192.168.0.2, and in mythtv-setup, make sure that 192.168.0.2 is
assigned as the IP address for the backend.

If that does not fix it, then you could try assigning a real static
address to the box, not a fixed IP address from the router via DHCP. I
am not sure how you do that in on your system, as I am not using 16.04
yet.  In 14.04, you can do that using the NetworkManager applet, or
(my preference), uninstall NetworkManager and set it in the
/etc/networks/interfaces file:

iface eth0 inet static
  address 192.168.0.2
  netmask 255.255.255.0
  gateway 192.168.0.x   <== Your router's address

And if that still does not fix it, then you probably need to adjust
how mythbackend gets started.  To test if that is the problem, after
everything is up and the IP addresses have been assigned, restart
mythbackend.  It should then bind to the ethernet card IPv4 address
correctly and everything should work.

In Mythbuntu 14.04, mythbackend gets started after the localhost
network interface gets started.  That is fine if you are just running
a combined frontend/backend machine, but if you are allowing external
access to the backend from other frontends, as you are doing, the
startup of mythbackend needs to be delayed until the ethernet cards
are up and have been assigned IP addresses.  That is much later than
the localhost interface.  For me on Mythbuntu 14.04, which uses
upstart to start things, that meant changing the
/etc/init/mythtv-backend.conf file.  I changed this line:

start on (local-filesystems and net-device-up IFACE!=lo and started
udev-finish)

to this:

start on (local-filesystems and net-device-up IFACE=eth0 and
net-device-up IFACE=br0 and net-device-up IFACE=eth1 and started
udev-finish)

In your case, you would need to have it wait for the ethernet card
that has 192.168.0.2 on it, probably eth0, so that would need:

start on (local-filesystems and net-device-up IFACE=eth0 and started
udev-finish)

Unfortunately, the MythTV install process on Ubuntu (up to 14.04
anyway) does not make this change in the config files when you select
that you want to allow external access for MythTV.  I believe that is
a bug.

In 16.04, I believe that upstart is gone and the config for starting
things is done via systemd, which I know nothing about yet.  Hopefully
someone else can advise how to configure it for systemd - I think I
skimmed over a thread on this list not too long ago that had something
about systemd config.


More information about the mythtv-users mailing list