better service restart

This commit is contained in:
Roland Gruber 2016-05-29 10:22:33 +02:00
parent 12d8870334
commit 36add79764
1 changed files with 18 additions and 21 deletions

View File

@ -126,29 +126,26 @@ if [ ! -f /var/lib/%{lam_dir}/config/config.cfg ]; then
chown %{lam_uid}:%{lam_gid} /var/lib/%{lam_dir}/config/lam.conf chown %{lam_uid}:%{lam_gid} /var/lib/%{lam_dir}/config/lam.conf
fi fi
fi fi
%if %is_suse for server in "apache2 httpd nginx"; do
/usr/sbin/a2enmod version > /dev/null if [ `which systemctl` ]; then
/etc/init.d/apache2 reload if [ "`systemctl is-active ${server}.service`" = "active" ]; then
%endif systemctl reload ${server}.service
%if %is_fedora fi
if [ -e /etc/init.d/httpd ]; then elif [ -e /etc/init.d/${server} ]; then
/etc/init.d/httpd reload /etc/init.d/$server reload > /dev/null 2>&1 || :
else fi
/bin/systemctl reload httpd.service done
fi
%endif
%postun %postun
%if %is_suse for server in "apache2 httpd nginx"; do
/etc/init.d/apache2 reload if [ `which systemctl` ]; then
%endif if [ "`systemctl is-active ${server}.service`" = "active" ]; then
%if %is_fedora systemctl reload ${server}.service
if [ -e /etc/init.d/httpd ]; then fi
/etc/init.d/httpd reload elif [ -e /etc/init.d/${server} ]; then
else /etc/init.d/$server reload > /dev/null 2>&1 || :
/bin/systemctl reload httpd.service fi
fi done
%endif
%files %files
%defattr(-, root, root) %defattr(-, root, root)