Some services failing to start at boot

Changing the GPU memory to 128MB resolved the issue with MySQL and I can still watch HD movies so that’s the primary issue solved! Many thanks @DBMandrake. :grinning: :grinning: :grinning:

Now to the other services which aren’t starting; “openvpn” and “nfs-kernel-server”.

I should rephrase that really as they are starting, just in the wrong order to work.

nfs-kernel-server seems to be starting before rpcbind, which means it isn’t registering and so doesn’t work (see below)

[18:50 gavin@osmc ~] > sudo showmount -e --no-headers
clnt_create: RPC: Program not registered
[18:53 gavin@osmc ~] > sudo systemctl restart nfs-kernel-server
[18:53 gavin@osmc ~] > sudo showmount -e --no-headers
/pidata 10.*.*.0/24,192.168.*.0/24
[18:53 gavin@osmc ~] > 

How can I make nfs-kernel-server start by default after rpcbind?

And OpenVPN has a similar issue, it seems to be starting before the network is up (see below)

[18:49 gavin@osmc ~] > sudo cat /var/log/openvpn.log
Fri Sep  4 16:15:20 2015 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec  5 2014
Fri Sep  4 16:15:20 2015 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Fri Sep  4 16:15:22 2015 Control Channel Authentication: using '/etc/openvpn/easy-rsa/keys/ta.key' as a OpenVPN static key file
Fri Sep  4 16:15:22 2015 TCP/UDP: Socket bind failed on local address [AF_INET]192.168.*.*:1194: Cannot assign requested address
Fri Sep  4 16:15:22 2015 Exiting due to fatal error
[18:49 gavin@osmc ~] > sudo systemctl restart openvpn
[18:49 gavin@osmc ~] > sudo cat /var/log/openvpn.log
Sun Sep  6 18:49:58 2015 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec  5 2014
Sun Sep  6 18:49:58 2015 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Sun Sep  6 18:49:58 2015 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x.  Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Sun Sep  6 18:49:59 2015 Control Channel Authentication: using '/etc/openvpn/easy-rsa/keys/ta.key' as a OpenVPN static key file
Sun Sep  6 18:49:59 2015 TUN/TAP device tun0 opened
Sun Sep  6 18:49:59 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Sep  6 18:49:59 2015 /sbin/ip link set dev tun0 up mtu 1500
Sun Sep  6 18:49:59 2015 /sbin/ip addr add dev tun0 local 10.*.*.1 peer 10.*.*.2
Sun Sep  6 18:49:59 2015 GID set to nogroup
Sun Sep  6 18:49:59 2015 UID set to nobody
Sun Sep  6 18:49:59 2015 UDPv4 link local (bound): [AF_INET]192.168.*.*:1194
Sun Sep  6 18:49:59 2015 UDPv4 link remote: [undef]
Sun Sep  6 18:49:59 2015 Initialization Sequence Completed

In a systemV-init world the order was controlled by changing the number in the symlink in the /etc/rc*.d directories, but I have tried that and I suspect that this is not followed in a systemd world.

The file “/lib/systemd/system/openvpn.service” contains the following:

# This service is actually a systemd target,
# but we are using a service since targets cannot be reloaded.

[Unit]
Description=OpenVPN service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn

[Install]
WantedBy=multi-user.target

To me, this says (just as the legacy /etc/init.d/openvpn script does) that OpenVPN shouldn’t be started until after the network is up. Is it failing to do this because OSMC uses connman instead of NM? In which case what should I change this line to to wait for connman to have configured the network?