diff --git a/nis.sh b/nis.sh index 03cb976..6f37461 100755 --- a/nis.sh +++ b/nis.sh @@ -52,38 +52,34 @@ nis_config() { if [ -n "${new_nis_domain}" ]; then domainname "${new_nis_domain}" save_config_file - let contents=0 echo '# generated by /sbin/dhclient-script' > ${CONF} fix_context ${CONF} if [ -n "${new_nis_servers}" ]; then for i in ${new_nis_servers} ; do echo "domain ${new_nis_domain} server ${i}" >> ${CONF} - let contents=contents+1 done else echo "domain ${new_nis_domain} broadcast" >> ${CONF} - let contents=contents+1 fi - if [ ${contents} -gt 0 ]; then - service ypbind condrestart >/dev/null 2>&1 - fi elif [ -n "${new_nis_servers}" ]; then save_config_file echo '# generated by /sbin/dhclient-script' > ${CONF} fix_context ${CONF} - let contents=0 for i in ${new_nis_servers} ; do echo "ypserver ${i}" >> ${CONF} - let contents=contents+1 done - if [ $contents -gt 0 ]; then - service ypbind condrestart >/dev/null 2>&1 - fi fi + + # dimainname or servers changed, restart ypbind + if [ "${old_nis_domain}" != "${new_nis_domain}" ] \ + || [ "${old_nis_servers}" != "${new_nis_servers}" ] + then + service ypbind condrestart >/dev/null 2>&1 + fi fi } diff --git a/ypbind.spec b/ypbind.spec index 726e14f..e2498dd 100644 --- a/ypbind.spec +++ b/ypbind.spec @@ -2,7 +2,7 @@ Summary: The NIS daemon which binds NIS clients to an NIS domain Name: ypbind Epoch: 3 Version: 1.38 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Daemons Source0: http://www.linux-nis.org/download/ypbind-mt/ypbind-mt-%{version}.tar.bz2 @@ -99,6 +99,11 @@ install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/ypbind-post-waitbind %doc README NEWS COPYING %changelog +* Mon Jan 25 2016 Matej Muzila 3:1.38-4 +- Do not resstart ypbind on dhcp renew if nis domain or nis servers + haven't changed + Resolves: rhbz#1301708 + * Mon Nov 16 2015 Matej Muzila 3:1.38-3 - Load ypbind.service before nss-user-lookup.target Resolves: rhbz#1282440