diff --git a/recipes-extra/openvpn/openvpn_2.3.6.bb b/recipes-extra/openvpn/openvpn_2.3.6.bb index bb00043..ed3376d 100644 --- a/recipes-extra/openvpn/openvpn_2.3.6.bb +++ b/recipes-extra/openvpn/openvpn_2.3.6.bb @@ -40,6 +40,7 @@ do_install_append() { install -m 0755 ${WORKDIR}/openvpn-generator ${D}${systemd_unitdir}/system-generators } +RDEPENDS_${PN} += "update-rc.d" RRECOMMENDS_${PN} = "kernel-module-tun" FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug" @@ -48,6 +49,18 @@ FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug" # during install and upgrade. Simply ship the files. FILES_${PN} += "${systemd_unitdir}" +pkg_postinst_${PN} () { + if [ "x$D" != "x" ]; then + exit 1 + fi + + if [ -L /etc/rc2.d/S*openvpn ]; then + update-rc.d -f openvpn remove + if [ ! -L /etc/systemd/system/multi-user.target.wants/openvpn.service ]; then + ln -s '/lib/systemd/system/openvpn.service' '/etc/systemd/system/multi-user.target.wants/openvpn.service' + fi + fi +} # We need to test opkg upgrade of OpenVPN through the OpenVPN first DEFAULT_PREFERENCE = "-1"