Wait for networking on reboot (ubuntu network-online.target)

Hi,

When my system reboots, the tuners always seem to vanish (see attached screenshot).
I can correct it easily manually, by running scan network from the web interface, and then toggling both bonjour and remote access of and on again, but I suspect it's still a problem if an unexpected reboot occurs. Perhaps Channels DVR starts up before my network is fully configured? In any case, it would be good to have a fix for this. Maybe re-scan after a minute if nothing is detected on startup? I should add that this is on an ARM64 Odroid C2 running Ubuntu 16.04.

Thanks,

-Karl

The ubuntu service is configured to wait for the network, and has been confirmed as working by other ubuntu users.

It’s possible the After=network-online.target in /etc/systemd/system/channels-dvr.service isn’t working as intended on your system for some reason.

Sounds reasonable. I checked, and running:

sudo systemctl restart channels-dvr.service

fixed it, which would be consistent with your suggestion.

I also ran:

mitchekl@odroid64:/etc/systemd/system/network-online.target.wants$ sudo systemctl status network-online.target
â—Ź network-online.target - Network is Online
   Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor preset: enabled)
   Active: active since Tue 2017-01-17 17:28:50 PST; 10min ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

Jan 17 17:28:50 odroid64 systemd[1]: Reached target Network is Online.

Which appears to suggest that the service at least is good. The same applies to networking.service and NetworkManager-wait-online.service, which are both within the network-online.target.wants folder. So I’m not quite sure what is going on.

I wonder if it’s the same issue as here:

http://unix.stackexchange.com/questions/209832/debian-systemd-network-online-target-not-working

Any suggestions? For the time being, I will add a ( sleep 30 ; systemctl restart channels-dvr.service ) & somewhere in the boot sequence as a dirty fix, but that seems terribly inelegant.

And to make matters more frustrating, restarting the service no longer works on the 2017.01.17.2332 version. The web service locks up when either I run sudo systemctl restart channels-dvd.service or when I scan for tuners. If I redirect the “latest” symlink to the 2017.01.14.0019 version and then restart, it’s fine, and it continues to run okay until the next reboot, at which point I have to do it again.

A bad build went out. It’s currently being worked on. You can read more and follow along here:

1 Like

The suggestion that After=network-online.target was not working correctly was a good one.

It seems that my problem came down to the fact that I had never used ubuntu tools to configure the network, as I run it headless. As a result, eth0 was not registered to the daemons as an active ethernet device, despite it being perfectly happy receiving an IP address via DHCP. All I had to do was to edit /etc/network/interfaces and add the following lines:

auto eth0
iface eth0 inet dhcp

network-online.target is aware of the interface now. Thanks!

1 Like

Note that this bug comes back whenever I configure a system running Ubuntu 16.04 with the default tools. The only ways around it seem to be (i) a post login script to restart the service, or (ii) use the /etc/network/interfaces tool, which messes with the Ubuntu networking system a bit.

The latter is proving particularly annoying at present, as I am currently forced to use static IP due to my ethernet socket having a non-fixed Mac address, which for my setup necessitates a static IP, and the implementation of DNS nameservers seems to be broken when I move away from the Ubuntu default tools.

Is there any chance you could implement a “re-scan for tuners after 1 minute if none are found on initial scan” feature? This would save users from having to find workarounds.

Thanks!

Sure.

1 Like

Added to latest version.

1 Like