Posts by jau

    Welp, I powered it on this morning and everything is working. It seems I might have mixed up the order of my library testing and the creation of the default route yesterday.

    Anyway, the gist of it is if you have you're using a custom connman service unit file, make sure you include the addition of the default gateway.

    I figured out some more: the default route wasn't set. Before 8.2, I didn't set the default route and everything just worked. That tells me the default route was being set outside of my customized connman unit file. But, with 8.2, it seems I have to explicitly create the default route.

    The mysql errors are now all gone from the kodi log. The "network down" errors are gone, too. Even the "inaccessible" errors for the NFS shares are gone. But, I still can't play any of my movies or tv-shows. :/

    I'll have to poke at it tomorrow...

    For some reason, LibreELEC thinks the network is down:

    17:05:00.334 T:140685126657792 NOTICE: service.libraryautoupdate-1.0.0 : Starting network check

    17:05:00.366 T:140685126657792 NOTICE: service.libraryautoupdate-1.0.0 : Network down, not running

    17:06:00.379 T:140685126657792 NOTICE: service.libraryautoupdate-1.0.0 : Starting network check

    17:06:00.381 T:140685126657792 NOTICE: service.libraryautoupdate-1.0.0 : Network down, not running

    When I check the service, systemd is saying the service isn't enabled:

    ● connman.service - Connection service

    Loaded: loaded (/storage/.config/system.d/connman.service; disabled; vendor preset: disabled)

    Active: active (running) since Wed 2017-11-15 16:59:12 EST; 9min ago

    Is this normal behaviour? My custom network settings are being applied because I can ssh into the system and can see the DNS servers and search domains set correctly.

    I enabled connman to see what what would happen. The symlink was created and I restarted the service. But, the system still thought the network was down. Than I rebooted it, ran the status command to confirm the service was enabled still (it was) and saw in the logs the same "network down" message.


    I still don't know what's going on.


    Code
    cp /usr/lib/systemd/system/connman.service /storage/.config/system.d/

    And edit the file in /storage/.config/system.d to your needs.

    That doesn't work anymore! :( So I poked around and saw the following in the README file under .confg/system.d/:

    Code
    $HOME/.config/systemd/user/*
    /etc/systemd/user/*
    /run/systemd/user/*
    /usr/lib/systemd/user/*

    So I changed the path to .config/systemd/user and moved the connman.service file into that new directory. I restarted LibreELEC and while the DNS servers were set correctly, the search domains weren't added. WTF?

    I decided to change the ip of the secondary DNS server to see if the file is read at all, and sure enough, it isn't. It looks like connman is ignoring the device like I want it to, but the cusomt systemd unit file is being ignored.

    Maybe systemd is running on LibreELEC in a way that ignores the custom unit files? Here's what the README file says:

    It looks like systemd is running in "system mode" and is the reason why my custom unit file is being ignored. But, I could be wrong.

    Does anyone have any idea about what's going on?


    That is exactly the problem. But there is a solution. To circumvent connman to shutdown the interface on reboot/shutdown you need to prevent connman to manage the interface.
    Connman has an option to ignore interfaces via a blacklist in its configuration. The configuration is hard coded in squashfs image. But there is a script (/usr/lib/connman/connman-setup) that checks for a custom config before starting connman. Simply copy /etc/connman/main.conf to /storage/.config/connman_main.conf and add the network interface to NetworkInterfaceBlacklist option.

    That does work, but it causes other problems. With the ethernet device no longer managed by connmand, the DNS configuration can't be changed because it's hard coded into the systemd unit file for the connman service. DNS1 and DNS2 get set to Google's DNS servers. :(

    I tried to set the DNS servers in the connman_main.conf file and it failed to take because /etc/resolv.conf is actually a symlink to a connman dns config file. I don't want LibreELEC to be sending DNS queries to Google's servers: I have my own internal DNS server that I'd rather use and in fact have to because my database is centralized on a MariaDB KVM. With LibreELEC set to use Google's DNS servers, Kodi can't find the library.

    It also seems the default route isn't being set properly because LibreELEC can't reach the Internet (e.g. addon downloads fail).

    Is there another workaround I can try? I've been thinking that maybe I can setup a cron job on a server to check if the LibreELEC systems are up and if they are, to login and change the systemd config so that shutdowns and reboots work properly. The only problem with my craptastic idea is that I don't know for sure what's happening: is the file system being unmounted too soon or is the network shutting down too early?