Running OH on a Raspberri pi 3 that runs as Kodi box, hence I have openvpn starting automatically as a service…problem is that openvpn starts before OH and this creates OH to bind to the wrong IP address, for example:
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 172.21.20.xxx
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 10.1.10.100
[INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://172.21.20.yyy:8080
And this is creating issues in my OH because the 172.21.20.yyy is the other end of the vpn tunnel hence unreachable from within the house.
How can I change the services startup order so OH starts before openvpn?
What OS are you running? If it’s debian based then it should use systemd as init system. Then its possible to configure your openvpn programs service file to start it only after OH.
So you mean disable openvpn and then have OH start openvpn once is up?
I’m not great in Linux and similar but in Windows you can set service dependencies, I guess that there is something like that in Linux too right?
Ideally I’d set openvpn depending on OH so OH starts first and VPN after
Why are you all giving somekind of workarounds? There’s systemd witch already handles loading all your services at startup. It takes only to add one line to your openvpns service file that tells systemd to start openvpn after OH.
Use google and find out where your unit files are located. Edit the one witch handles openvpn and add this line After=openhab2.service. Then use daemon-reload command to activate the changes.
cause the original request is in the wrong direction.
there is an OH2 parameter (NetUtil) for this purpose and this is the best solution.
if the OH2 service will be restarted, he will face the same issue.
Of course it’s a workaround.
But because I have this kind of switching enabled in my OH anyway (OpenVPN will only be activated, when I am NOT at home), this suggestion was pretty logical from my point of view.
As I answered your original question considering startup, @Dim has a valid point that while system is running and you only restart OH you most likely face the same problem. I suggest you to do what dim proposed.
I think the issue with myopenhab is because now OH binds to 10.1.10.100 but the openhabcloud.internal.CloudClient instead looks for base URL = http://localhost:8080
Any idea where I can force the CludClient to look for another address?