On Thu, Feb 18, 2016 at 02:32:43PM +0000, Mark Brown wrote:
> On Fri, Jan 22, 2016 at 01:47:36PM -0800, Nye Liu wrote:
>
> > > It should eventually figure things out?
>
> > No, but I have a patch for nis script, attached...
>
> I can't tell what this patch is supposed to do, sorry.
It retries starting ypbind until it stays running.
If rpcbind isn't running this script hangs forever... it never detects
that ypbind doesn't stay running, because ypbind exits if rpcbind
isn't running.
>
> > --- dist/nis 2016-01-20 16:18:24.171239577 -0800
> > +++ nis 2016-01-22 13:08:19.532968676 -0800
> > @@ -43,24 +43,38 @@
> >
> > if [ "`ypwhich 2>/dev/null`" = "" ]
> > then
> > + running=""
> > bound=""
> > log_action_begin_msg "binding to YP server"
> > - for i in 1 2 3 4 5 6 7 8 9 10
> > + for i in `seq 10`
> > do
> > sleep 1
> > - log_action_cont_msg "."
> > - if [ "`ypwhich 2>/dev/null`" != "" ]
> > + # make sure ypbind started; rpcbind might not be
> > ready yet
> > + if [ -n "$( pidofproc ${NET}/ypbind )" ]
> > then
> > - echo -n " done] "
> > - bound="yes"
> > - break
> > + log_action_cont_msg "."
> > + running="yes"
> > + if [ "`ypwhich 2>/dev/null`" != "" ]
> > + then
> > + echo -n " done] "
> > + bound="yes"
> > + break
> > + fi
> > + else
> > + running=""
> > + # try to start ypbind again
> > + log_action_cont_msg "x"
> > + ypbind_start
> > fi
> > done
> > # This should potentially be an error
> > if [ "$bound" ] ; then
> > log_action_end_msg 0
> > - else
> > + elif [ "$running" ] ; then
> > log_action_end_msg 1 "backgrounded"
> > + else
> > + log_action_end_msg 1 "failed"
> > + exit 1
> > fi
> > fi
> > }
--
Nye Liu
[email protected]
(747) 224-2253
(818) 772-0576 fax
"Who would be stupid enough to quote a fictitious character?"
-- Don Quixote
MRV Communications is a global supplier of packet and optical solutions that
power the world’s largest networks. Our products combine innovative hardware
with intelligent software to make networks smarter, faster and more efficient.