[mythtv-users] delaying backend startup until the network is up
James Abernathy
jfabernathy at gmail.com
Wed Dec 19 21:02:12 UTC 2018
On 12/19/18 11:39 AM, James Abernathy wrote:
>
>> On Dec 19, 2018, at 10:45 AM, James Abernathy <jfabernathy at gmail.com
>> <mailto:jfabernathy at gmail.com>> wrote:
>>
>>>>
>>>> I think for safety sake, I'd use the full-internet.service and
>>>> wait-until-pingable.py approach. But since wait-until-pingable.py waits
>>>> for what it wants, the "After=NetworkManager-wait-online.service" could
>>>> really be anything network related because the script waits, right??
>>>>
>>>> -------------------------------------full-internet.service------------------------
>>>>
>>>> [Unit]
>>>> Description=Wait for full internet service to be available
>>>> including DNS
>>>> After=NetworkManager-wait-online.service
>>>>
>>>> [Service]
>>>> Type=simple
>>>> ExecStartPre=/usr/local/bin/wait-until-pingable.py my.hdhomerun.com
>>>> <http://my.hdhomerun.com> 30
>>>> ExecStart=/bin/true
>>>>
>>>> [Install]
>>>> WantedBy=multi-user.target
>>> Yes, if you do not want to have NetworkManager-wait-online.service
>>> enabled, or are not using NetworkManager, you could just have
>>> full-internet.service run After=network.target. That way, with the
>>> next update of wait-until-pingable.py, you would also get a log
>>> message that tells you how long it had to wait for the network to
>>> complete coming up.
>>
>> Since my production system only uses Ubuntu Server and static IPs,
>> there is no need for NetworkManager. So after network.target would be
>> an improvement. I'll test all this some more.
>>
>> Jim A
>>
>
> So the first test is to start over and see what’s installed by
> default. I installed Ubuntu Server 18.04.1 with no snaps or packages.
> I took the defaults on everything. Since my eno1 mac address is in my
> router as fixed to an IP, I went with the default DHCP and got the
> right address from my router.
>
> 1) NetworkManager is not installed
> 2) systemd-networkd-wait-onine.service is enabled and active
> 3) network.target is enabled and active
>
> I’ll install mythtv-backend with mythhdhrrecorder and see what we get
> with the different delaying tactics for mythtv-backend.service
>
> Jim A
>
>
So I did a complete mythtv-backend build on the Ubuntu Server 18.04.1,
including external recorder, mythhdhrrecorder, and setup the
mythtv-backend.service.d/override.conf to have:
------------------------------------
[Unit]
After=full-internet.service
---------------------------------------
I have full-internet.service set:
-------------------------------------------------------
[Unit]
Description=Wait for full internet service to be available including DNS
After=network.target
[Service]
Type=simple
ExecStartPre=/usr/local/bin/wait-until-pingable.py my.hdhomerun.com 30
ExecStart=/bin/true
[Install]
WantedBy=multi-user.target
----------
This works fine especially since NetworkManager is not installed or running.
I tested booting with the ethernet cable unplugged and it stalled for 90
seconds with the console message:
"A start job is running for Wait for Network to be Configured (1min 31s
/ no limit)"
It booted to the console after the 90 seconds.
Jim A
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20181219/a2ac4caa/attachment.html>
More information about the mythtv-users
mailing list