Thursday, October 9, 2008

Winbind in Intrepid

We use winbind at work to auth our Ubuntu desktops to Active Directory. I am the first to upgrade to Intrepid, in which winbind seems to be broken. It fails at random intervals (or so it seems). The way I found easiest to get it back up is to run wbinfo -u. If you don't do this, you can't use sudo, pwd won't work (a lot of stuff breaks, essentially). So, to hack around it, I wrote a script called keepActiveDirectoryAlive and put it in $HOME/bin.

keepActiveDirectoryAlive:


#!/bin/bash

while true
do
sleep 30s; wbinfo -u;
done


Easy! This probably isn't the best or most efficient way to do this, so if you have a better idea, I am more than welcome to suggestions.

I set this to start with GNOME in my Sessions. I also had to set wbinfo -u to run in /etc/rc.local (though I seem to remember Ubuntu/Debian ignoring this file) so that I can login through GDM. It seems to be working as expected.

8 comments:

  1. There isn't any difference between what I am doing here and what cron does.

    ReplyDelete
  2. One suggestion would be to file a bug if you haven't already...

    ReplyDelete
  3. There is already a bug open for it (has been since dapper iirc).

    ReplyDelete
  4. You might wanna try Likewise, which works pretty much okay for us. I can't remember ever having had these problems with winbind. This sounds like a serious show-stopper to me.

    ReplyDelete
  5. This is ugly. Instead some supervising daemon should be used, like
    capabilities of SMF in Solaris 10: if a "service" dies it respawn it, I
    really miss this from Linux, to have a robust init mechanism which can
    handle this as well. Maybe upstart is able to do this, just currently it's
    used merely in SysV init compatible mode, no major gain from upstart this
    way for a while ... It can be useful for many services which should be
    restarted if something bad happens ...

    ReplyDelete
  6. I've had the same problem since I first installed winbind with Ubuntu 7.04. I worked around it by having cron run the following script every minute:

    #!/bin/bash
    if ! /usr/bin/wbinfo -p > /dev/null ; then
    /usr/bin/killall -9 winbindd
    /etc/init.d/winbind stop
    /etc/init.d/samba restart
    /etc/init.d/winbind start
    fi

    if I didn't kill samba and winbind in this way when the winbind ping failed... I could login or much else.

    I really hope this gets fixed someday :-/

    PS - *please* enable OpenID commenting :-)

    ReplyDelete
  7. I know this is pretty old, but did you ever get this fixed? I've been using the script someone posted and added it as a cron job every minute, but winbind still dies on me. Any link to the official bug, so I can follow it?

    ReplyDelete