diff --git a/ypbind-pre-setdomain b/ypbind-pre-setdomain index 2c97541..9b22a8c 100755 --- a/ypbind-pre-setdomain +++ b/ypbind-pre-setdomain @@ -7,22 +7,30 @@ # itself. If $NISDOMAIN is not defined, it reads config file. # +TIMEOUT=5 DOMAINNAME=`domainname` if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then echo -n $"Setting NIS domain: " + seconds=0 + while [ $seconds -lt $TIMEOUT ]; do if [ -n "$NISDOMAIN" ]; then - domainname $NISDOMAIN - echo $"'$NISDOMAIN' (environment variable)" + domainname $NISDOMAIN + echo $"'$NISDOMAIN' (environment variable)" + break else # See if the domain is set in config file - NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf` - if [ -n "$NISDOMAIN" ]; then - domainname $NISDOMAIN - echo $"'$NISDOMAIN' (/etc/yp.conf)" - else - logger -t ypbind $"domain not found" - exit 1 + NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf` + if [ -n "$NISDOMAIN" ]; then + domainname $NISDOMAIN + echo $"'$NISDOMAIN' (/etc/yp.conf)" + break + else + seconds=$(($seconds+1)) + sleep 1 fi fi + done + # Give up if NISDOMAIN is still not set + [ -z "$NISDOMAIN" ] && logger -t ypbind $"domain not found" && exit 1 fi #/etc/rpc check diff --git a/ypbind.service b/ypbind.service index 67d1a06..23f6b0b 100644 --- a/ypbind.service +++ b/ypbind.service @@ -2,6 +2,7 @@ [Unit] Description=NIS/YP (Network Information Service) Clients to NIS Domain Binder Requires=rpcbind.service +Wants=nss-user-lookup.target After=syslog.target network-online.target rpcbind.service ypserv.service NetworkManager-wait-online.service Before=systemd-user-sessions.service Before=nss-user-lookup.target diff --git a/ypbind.spec b/ypbind.spec index 3eacb33..1c1f4ee 100644 --- a/ypbind.spec +++ b/ypbind.spec @@ -112,6 +112,15 @@ install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/ypbind-post-waitbind * Fri May 19 2017 Matej Mužila - 3:2.4-1 - Update to version 2.4 supporting IPv6 +* Wed Mar 29 2017 Petr Kubat - 3:1.38-10 +- Wait a while for dhcp to set up the domain (#1170400) + +* Mon Mar 20 2017 Petr Kubat - 3:1.38-9 +- Add a Wants dependency on nss-user-lookup.target (#1282440) + +* Sat Feb 11 2017 Fedora Release Engineering - 3:1.38-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Wed Nov 23 2016 Ralf Corsépius - 3:1.38-7 - Remove check for libsystemd-daemon from ypbind-systemdso.patch (RHBZ#1396893). - Add check for systemd/sd-daemon.h to ypbind-systemdso.patch.