diff --git a/openvpn.spec b/openvpn.spec index 5a0737ce67178edc8e4c6b922940144f9f4d2383..313e107ee6d9bdc9e5eeceda8a42388c153beabe 100644 --- a/openvpn.spec +++ b/openvpn.spec @@ -1,6 +1,6 @@ Name: openvpn Version: 2.4.8 -Release: 2 +Release: 3 Summary: A full-featured open source SSL VPN solution License: GPLv2 URL: https://community.openvpn.net/openvpn @@ -66,17 +66,40 @@ getent passwd openvpn &>/dev/null || \ -d /etc/openvpn openvpn %post -%systemd_post openvpn-client@\*.service -%systemd_post openvpn-server@\*.service +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl --no-reload preset openvpn-client@\*.service &>/dev/null || : +fi + + +if [ $1 -eq 1 ] ; then + # Initial installation + systemctl --no-reload preset openvpn-server@\*.service &>/dev/null || : +fi %preun -%systemd_preun openvpn-client@\*.service -%systemd_preun openvpn-server@\*.service +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + systemctl --no-reload disable --now openvpn-client@\*.service &>/dev/null || : +fi + + +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + systemctl --no-reload disable --now openvpn-server@\*.service &>/dev/null || : +fi %postun -%systemd_postun_with_restart openvpn-client@\*.service -%systemd_postun_with_restart openvpn-server@\*.service +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart openvpn-client@\*.service &>/dev/null || : +fi + +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + systemctl try-restart openvpn-server@\*.service &>/dev/null || : +fi %files %license AUTHORS COPYING COPYRIGHT.GPL @@ -100,6 +123,9 @@ getent passwd openvpn &>/dev/null || \ %{_mandir}/man8/%{name}.8* %changelog +* Tue Mar 16 2020 daiqianwen 2.4.8-3 +- modify systemd post preun postun + * Mon Nov 11 2019 guanyalong 2.4.8-2 - Type:enhancement - ID:NA