modify systemd post preun postun

This commit is contained in:
daidai_is_here 2020-03-16 20:13:13 +08:00
parent 4234dee2b9
commit 967599712c

View File

@ -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,18 +66,41 @@ 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
%config %{_sysconfdir}/%{name}/*/*
@ -100,6 +123,9 @@ getent passwd openvpn &>/dev/null || \
%{_mandir}/man8/%{name}.8*
%changelog
* Tue Mar 16 2020 daiqianwen <daiqianwen@huawei.com> 2.4.8-3
- modify systemd post preun postun
* Mon Nov 11 2019 guanyalong <guanyalong@huawei.com> 2.4.8-2
- Type:enhancement
- ID:NA