Stop ypserv daemon temporary when reading info about maps

This commit is contained in:
Honza Horák 2013-02-04 13:31:12 +01:00
parent b5e1c16543
commit 718449681a
1 changed files with 14 additions and 1 deletions

View File

@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.29
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: http://www.linux-nis.org/download/ypserv/ypserv-%{version}.tar.bz2
@ -200,6 +200,12 @@ fi
%global rebuild_maps_script /var/yp/rpm_rebuild_maps
%pre
if [ $1 == 2 ] ; then
# stop ypserv if running and then start it again
ypservactive=0
if /usr/bin/systemctl is-active ypserv.service>/dev/null 2>&1 ; then
ypservactive=1
/usr/bin/systemctl stop ypserv.service>/dev/null 2>&1
fi
# store old domainname and set the correct one
olddomain=`domainname`
. /etc/sysconfig/network
@ -231,6 +237,10 @@ if [ $1 == 2 ] ; then
echo "make NOPUSH=true -C /var/yp" >> %rebuild_maps_script
fi
/bin/domainname "$olddomain"
# if ypserv was running before, start it again
if [ $ypservactive -eq 1 ] ; then
/usr/bin/systemctl start ypserv.service>/dev/null 2>&1
fi
fi
%triggerpostun -- ypserv < %{first_tc_version}
@ -256,6 +266,9 @@ fi
%{_includedir}/*/*
%changelog
* Mon Feb 04 2013 Honza Horak <hhorak@redhat.com> - 2.29-8
- Stop ypserv daemon temporary when reading info about maps
* Mon Jan 28 2013 Honza Horak <hhorak@redhat.com> - 2.29-7
- Open maps with no blocking for reading