From 718449681a253f7cd549cd51efd319e6c2e0c78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Hor=C3=A1k?= Date: Mon, 4 Feb 2013 13:31:12 +0100 Subject: [PATCH] Stop ypserv daemon temporary when reading info about maps --- ypserv.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ypserv.spec b/ypserv.spec index 57609c3..599080b 100644 --- a/ypserv.spec +++ b/ypserv.spec @@ -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 - 2.29-8 +- Stop ypserv daemon temporary when reading info about maps + * Mon Jan 28 2013 Honza Horak - 2.29-7 - Open maps with no blocking for reading