winbind won't start at boot

Bug #1078699 reported by Diego Zuccato
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Confirmed
High
Unassigned

Bug Description

Winbind, by default, gets started too early (S20), resulting in daemon termination and impossible login w/ users from AD.
If I connect as a local admin and restart winbind service, all goes well.

In /var/log/apport.log :
ERROR: apport (pid 1566) Tue Nov 13 11:07:39 2012: called for pid 872, signal 6
ERROR: apport (pid 1566) Tue Nov 13 11:07:39 2012: executable: /usr/sbin/winbindd (command line "/usr/sbin/winbindd")
ERROR: apport (pid 1566) Tue Nov 13 11:07:39 2012: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 1566) Tue Nov 13 11:07:39 2012: apport: report /var/crash/_usr_sbin_winbindd.0.crash already exists and unseen, doing nothing to avoid disk usage DoS
ERROR: apport (pid 1976) Tue Nov 13 19:56:56 2012: called for pid 1599, signal 6
ERROR: apport (pid 1976) Tue Nov 13 19:56:56 2012: executable: /usr/bin/nautilus (command line "nautilus -n")
ERROR: apport (pid 1976) Tue Nov 13 19:56:56 2012: Unhandled exception:
Traceback (most recent call last):
  File "/usr/share/apport/apport", line 322, in <module>
    if info.check_ignored():
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 895, in check_ignored
    dom = self._get_ignore_dom()
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 834, in _get_ignore_dom
    ifpath = os.path.expanduser(_ignore_file)
  File "/usr/lib/python2.7/posixpath.py", line 260, in expanduser
    userhome = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 238500'
ERROR: apport (pid 1976) Tue Nov 13 19:56:56 2012: pid: 1976, uid: 238500, gid: 100013, euid: 0, egid: 0
ERROR: apport (pid 1976) Tue Nov 13 19:56:56 2012: environment: {}

1) Using 12.04_LTS.
2) # apt-cache policy winbind
winbind:
  Installato: 2:3.6.3-2ubuntu2.3
  Candidato: 2:3.6.3-2ubuntu2.3
  Tabella versione:
 *** 2:3.6.3-2ubuntu2.3 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
        100 /var/lib/dpkg/status
     2:3.6.3-2ubuntu2.1 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages
     2:3.6.3-2ubuntu2 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
3) expected # service winbind status
 * winbind is running
4) getting # service winbind status
 * winbind is not running

I tried to change S20winbind to S80winbind in /etc/rc*.d but seems it still gets started too early.
An ugly workaround is starting it from rc.local, delaying for a minute or so... but it's really too ugly!

Revision history for this message
Robie Basak (racb) wrote :

Possibly related to bug 1083407?

Revision history for this message
Diego Zuccato (diego-zuccato) wrote :

I don't think so, but might be (hard to tell, when speaking of race conditions).
In 1083407 winbindd is hung, while in this case it exits. And the machines where I experienced that are actually quite slow.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ok, first off, winbind.conf has this old relic start on

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

This will start winbind as soon as *any* network interface is up, which is not what we want. The appropriate conditions are:

start on runlevel [2345]
stop on runlevel [^2345]

This will make sure that winbind waits for all of the interfaces in /etc/network/interfaces to be up.

Now, in the lsb-init script from Debian:

# Should-Start: samba

This means that winbind needs to ensure samba is started before it starts. Now, samba is broken up into smbd and nmbd in the Ubuntu packages. So the pre-start should really have this:

if [ -f /etc/init/smbd.conf ] ; then
    start wait-for-state WAITER=winbind WAIT_FOR=smbd
fi
# repeat for nmbd

However, its not entirely clear if any of this will actually solve the issue reported here. Nevertheless, its stuff that needs to happen.

Diego, is there any way you can look through the logs on an affected system and find the error messages from winbind? I thin it logs somewhere in /var/log/samba.

Changed in samba (Ubuntu):
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Diego Zuccato (diego-zuccato) wrote :

IIUC, winbind should be started *before* smbd, not after (smbd uses winbind, if available, for mapping). And actually I don't have smbd installed at all (I just use winbind to authenticate and authorize local users against AD).

To collect crash logs I'll have to install another system: the two affected already use the ugly patch (rc.local w/ a sleep 30 && service winbind restart ). It will take some time.

Revision history for this message
ghomem (gustavo) wrote :

A just slightly less ugly fix is introducing

/etc/rc2.d/S10sleep

with

RCDELAY=30
sleep $RCDELAY

Seems to work

Revision history for this message
Diego Zuccato (diego-zuccato) wrote :

Here's a dump directly from /var/crash

Just re-run version check:
# apt-cache policy winbind
winbind:
  Installato: 2:3.6.3-2ubuntu2.3
  Candidato: 2:3.6.3-2ubuntu2.3
  Tabella versione:
 *** 2:3.6.3-2ubuntu2.3 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2:3.6.3-2ubuntu2.1 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     2:3.6.3-2ubuntu2 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Robie Basak (racb)
Changed in samba (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba (Ubuntu):
status: New → Confirmed
Revision history for this message
gerstrong (gerstrong) wrote :

Using Ubuntu 14.04.1 LTS. I also have this bug ans as Clint Byrum (clint-fewbar) writes with lsb-init scripts I have to agree. I don't understand everything but I have the old settings and changed them now. Rebooting the system. Let's see if winbind and nmbd are loaded...

Revision history for this message
gerstrong (gerstrong) wrote :

Well, his fix did not work. Let's try the sleep hack

Revision history for this message
gerstrong (gerstrong) wrote :

No, not even the fix. I might have to look deeper into it. It's too bad, that this bug is that old.

Samba 4 is really great. Once installing and compiling by hand under Ubuntu it really rocks. I'm pretty sure there is a lot of mess with the packages patches and old scripts. We should find a way to fix those issue and make samba more reliable.

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.