Mailing List Archive

Mythbackend may be starting too soon?
I have a new build of Mythbuntu 16.04 and having problems getting HD-PVR
to do anything. I've traced it down to an error reported in the
mythbackend log:

May 21 12:35:34 nick mythbackend: mythbackend[1124]: C CoreContext
serverpool.cpp:269 (SelectDefaultListen) ServerPool: Host is configured
to listen on 192.168.0.124, but address is not used on any local network
interfaces.
....followed by several errors about the HDHR's.
....then, it's followed by:

May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6544
May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6544
May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6554
May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6554
May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6549
May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6549

I added a backend restart into rc.local, which resulted in: (sudo
service mythtv-backend restart)

Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6544
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6544
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6544
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP
[fe80::c81f:a37c:7ce5:d43c%enp2s0]:6544
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6554
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6554
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6554
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP
[fe80::c81f:a37c:7ce5:d43c%enp2s0]:6554
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6549
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6549
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP [::1]:6549
Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
serverpool.cpp:407 (listen) Listening on TCP
[fe80::c81f:a37c:7ce5:d43c%enp2s0]:6549

Now the HD-PVR works better (but the remote stopped working, don't know
if restart has anything to do with it). Is there a way make mythbackend
wait until the network is ready?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythbackend may be starting too soon? [ In reply to ]
On 07/02/2017 01:19 PM, Don Brett wrote:
> Is there a way make mythbackend wait until the network is ready?


If you are using systemd, which mythbuntu should be using, look at your
mythtv-backend.service file. You should find it somewhere under
/lib/systemd. It should include these lines. I believe there was a
version where one of the items in these lines was misspelled.

[Unit]
Description=MythTV Backend
Wants=mysql.service network-online.target
After=mysql.service network-online.target



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythbackend may be starting too soon? [ In reply to ]
Just a heads-up that this won't work for anyone who has a Ceton InfiniTV
card. That uses a virtual network interface, and the network-online.target
is happy once ANY network interface comes online. What tends to happen with
mine is:

1) System boots up
2) Ceton "network" comes up
3) systemd says, "hey, the network is up!"
4) mythbackend starts, listens on all available addresses
5) DHCP assigns address to ethernet card
6) Remote frontends fail to access mythbackend

-justin

On Sun, Jul 2, 2017 at 2:40 PM, Peter Bennett <cats22@comcast.net> wrote:

>
>
> On 07/02/2017 01:19 PM, Don Brett wrote:
>
>> Is there a way make mythbackend wait until the network is ready?
>>
>
>
> If you are using systemd, which mythbuntu should be using, look at your
> mythtv-backend.service file. You should find it somewhere under
> /lib/systemd. It should include these lines. I believe there was a version
> where one of the items in these lines was misspelled.
>
> [Unit]
> Description=MythTV Backend
> Wants=mysql.service network-online.target
> After=mysql.service network-online.target
>
>
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Mythbackend may be starting too soon? [ In reply to ]
On 02/07/17 18:19, Don Brett wrote:
> I have a new build of Mythbuntu 16.04 and having problems getting
> HD-PVR to do anything. I've traced it down to an error reported in
> the mythbackend log:
>
> May 21 12:35:34 nick mythbackend: mythbackend[1124]: C CoreContext
> serverpool.cpp:269 (SelectDefaultListen) ServerPool: Host is
> configured to listen on 192.168.0.124, but address is not used on any
> local network interfaces.
> ....followed by several errors about the HDHR's.
> ....then, it's followed by:
>
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6544
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6544
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6554
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6554
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6549
> May 21 12:35:36 nick mythbackend: mythbackend[1124]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6549
>
> I added a backend restart into rc.local, which resulted in: (sudo
> service mythtv-backend restart)
>
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6544
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6544
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6544
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP
> [fe80::c81f:a37c:7ce5:d43c%enp2s0]:6544
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6554
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6554
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6554
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP
> [fe80::c81f:a37c:7ce5:d43c%enp2s0]:6554
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 127.0.0.1:6549
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP 192.168.0.124:6549
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP [::1]:6549
> Jul 2 12:02:03 nick mythbackend: mythbackend[1828]: I CoreContext
> serverpool.cpp:407 (listen) Listening on TCP
> [fe80::c81f:a37c:7ce5:d43c%enp2s0]:6549
>
> Now the HD-PVR works better (but the remote stopped working, don't
> know if restart has anything to do with it). Is there a way make
> mythbackend wait until the network is ready?
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________

This may help, I was doing some work with VBox - a network connected
tuner and found on mythbuntu 16.04 the following worked for me (I did
try other things like wait-network-online etc).

Note I use /etc/network/interfaces file to configure static IP address
for the mythtv backend, rather than using a Router reservation.

To make sure backend start after network is properly configured, this
delays mythtv backend startup.

In a terminal on the machine running mythtv backend:

sudo systemctl edit mythtv-backend.service and add the following two lines:

[Unit]
After=multi-user.target
Requires=multi-user.target


Then exit from the edit screen (it uses nano by default, so Ctrl+x, then
y, then Return key) then either reboot the machine or do "sudo systemctl
restart mythtv-backend.service"


If the above does not work you could try adding the following lines as
well (this is really a last resort)

[Service]
ExecStartPre=/bin/sleep 20



Mike

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythbackend may be starting too soon? [ In reply to ]
On Sun, 2 Jul 2017 14:40:45 -0400, you wrote:

>On 07/02/2017 01:19 PM, Don Brett wrote:
>> Is there a way make mythbackend wait until the network is ready?
>
>
>If you are using systemd, which mythbuntu should be using, look at your
>mythtv-backend.service file. You should find it somewhere under
>/lib/systemd. It should include these lines. I believe there was a
>version where one of the items in these lines was misspelled.
>
>[Unit]
>Description=MythTV Backend
>Wants=mysql.service network-online.target
>After=mysql.service network-online.target

The network-online.target in the
/lib/systemd/system/mythtv-backend.conf file is insufficient to allow
external network access - it happens when the first network interface
comes up, which is normally localhost (127.0.0.1). You need to make
mythbackend wait until full network access is available.

Do NOT edit the /lib/systemd/system/mythtv-backend.conf file. It will
be overwritten next time the mythbackend package is updated. Instead
you need to create an override file that modifies mythtv-backend.conf,
using the mechanism prescribed by systemd. To do that, you need to go
to the /etc/systemd/system directory and create a new subdirectory.
Run these commands as root or use sudo at the front:

cd /etc/systemd/system
mkdir mythtv-backend.service.d
chown root:root mythtv-backend.service.d
chmod a=rx,u+w mythtv-backend.service.d
cd mythtv-backend.service.d

In the new subdirectory you need to create your override file. It can
have any name as long as it ends with .conf. This will create an
empty file for you to edit:

touch mythtv-backend-override.conf
chown root:root mythtv-backend-override.conf
chmod a=rw mythtv-backend-override.conf

Now edit your mythtv-backend-override.conf file and put in the
overrides needed to make mythbackend wait until the network is up. In
Mythbuntu 16.04 if you have not disabled Network Manager, then it can
be used to tell when the network is up enough for external accesses to
work. For that, put these lines in your mythtv-backend-override.conf
file:

[Unit]
Wants=NetworkManager-wait-online.service
After=NetworkManager-wait-online.service

Then run this command (sudo or as root):

systemctl enable NetworkManager-wait-online.service

Then you should be able to reboot and have mythbackend wait until the
network is up before it starts.

There are several previous threads on this list about this problem.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org