On Fri, Nov 20, 2020 at 11:21:00PM -0500, Predrag Punosevac wrote: > > Hi Misc, > > Has anybody else noticed a new race condition causing Unbound to fail > due to the fact that OpenVPN interface is not available. > > Since a few releases ago I have this in my rc.conf.local to start > openvpn server and unbound > > openvpn_flags=--config /etc/openvpn/server.conf > pkg_scripts=sshguard collectd smartd openvpn > sensorsd_flags= > snmpd_flags= > syslogd_flags="-h" > unbound_flags= > > Previously I was starting OpenVPN server via > /etc/hostname.tun0 > > file > > up link0 > !/usr/local/sbin/openvpn --daemon --config /etc/openvpn/server.conf
You don't need 'link0' anymore these days. > I noticed this morning after upgrading 2 of my OpenVPN servers that > unbound is failing to start because tun0 is not available on time. If I > go back to start OpenVPN server from /etc/hostname.tun0 file everything > works as expected. Leaving the creation of the tun0 interface up to OpenVPN is never going to work 100% of the time if other programs also depend on tun0 being present. Have you considered following "Using an /etc/hostname.* file with persist-tun" in /usr/local/share/doc/pkg-readmes/openvpn? And with that you could probably also apply the config tweaks under "Running OpenVPN in chroot".