NIS fails to bind to YP server during boot

Bug #354588 reported by Russel Winder
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nis (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: nis

On Intrepid booting a system that is expecting to bind to a YP server always goes into a:

binding to YP server...
...
...
...
...
...

etc. which takes ages. By default the start number of NIS is 18. However the default start number of Network Manager is 28 and so it is not really surprising that NIS is failing to bind since there is no network connection yet.

By setting the NIS start number to 30, i.e. something greater than 28, the problem goes away and booting is significantly extremely much faster.

Perhaps the default NIS start number should be changed?

Revision history for this message
MarianoAbsatz (el-baby) wrote :

OK... but GDM start number is 30 (and g < n), so I think that 29 is a better number than 30 (and is prime also) :-)

Revision history for this message
Russel Winder (russel) wrote :

I just noticed that actually the timeouts still happen but they happen very much more quickly. So this shift in start number doesn't actually solve the timeouts problem but because of the different state of the network adapter it doesn't give the delays and so the user gets a much faster boot up.

I have switched to using 29 pending a new release of the nis package.

Thanks for picking up on this, much appreciated.

Revision history for this message
MarianoAbsatz (el-baby) wrote :

Well... in fact, I don't think this is quite so...

The problem is how much time does ypbind take to actually start up and bind to the nis server...

My guess is that if this is run on the server itself it should be somehow quick and otherwise, it will depend on network condition and nis server responsivenes...

The point is that this is actually not an error condition but merely a warning and giving this a few more seconds may or may not help, depending on how soon you will _actually_ need the nis services up and binded to the server...

Here's what the startup script /etc/init.d/nis is doing in the bind_wait() function:

bind_wait()
{
    [ "`ypwhich 2>/dev/null`" = "" ] && sleep 1

    if [ "`ypwhich 2>/dev/null`" = "" ]
    then
        bound=""
        log_action_begin_msg "binding to YP server"
        for i in 1 2 3 4 5 6 7 8 9 10
        do
            sleep 1
            log_action_cont_msg "."
            if [ "`ypwhich 2>/dev/null`" != "" ]
            then
                echo -n " done] "
                bound="yes"
                break
            fi
        done
        # This should potentially be an error
        if [ "$bound" ] ; then
            log_action_end_msg 0
        else
            log_action_end_msg 1 "backgrounded"
        fi
    fi
}

So... it gives it 10 times 1 second + the time to run ypwich to actually bind the server.

The point is that even if this fails, ypbind is still running and, if there is a server available for the configured domain, it will eventually find it.

If you want to speed your boot times y _may_ want to try reducing the tries (which are blocking the next startup scripts from running) and replace the "for" line with a shorter one like:

        for i in 1 2 3
        do
            sleep 1
            log_action_cont_msg "."
            if [ "`ypwhich 2>/dev/null`" != "" ]
            then
                echo -n " done] "
                bound="yes"
                break
            fi
        done

Give it a try if you want, but I don't think _this_ kind of thing will be commited to the distro... I don't have a nis setup here at home to try this out and won't be at the office until Monday.

Revision history for this message
Russel Winder (russel) wrote :

I just upgraded to Jaunty and the huge delays getting through the NIS connection attempts are back. I notice that NetworkManager is now numbered 50 in the startup sequence whilst NIS is 29. I shall experiment with setting NIS to 60.

Revision history for this message
Alain Baeckeroot (alain-baeckeroot) wrote :

Try to add in /etc/default/nis :
YPBINDFLAGS=-no-dbus

See also #152794 which is rather old, and still not fixed :-(
 https://bugs.launchpad.net/bugs/152794

Revision history for this message
MarianoAbsatz (el-baby) wrote :

I'm still on intrepid (I never upgrade a working machine after a couple of weeks after release)... anyway, I'll try Alain solution in my machine on Monday (today is non-working day here and I don't have NIS at home)... I'll renumber my startup scripts again as they were originally and trye the --no-dbus trick...

Revision history for this message
Russel Winder (russel) wrote :

Resetting the NIS start number to 60 means that boots are quick on Jaunty. Not sure if the binding problem is still there though -- GDM starts and wipes the display.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.