smbd + ldap hangs at startup after update

Bug #728047 reported by Samuel Wolf
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openldap (Ubuntu)
Triaged
Medium
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned
samba (Ubuntu)
Triaged
Medium
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: samba

we have samba running with ldap authentication.
After today's update apparently ldap is started before samba which causes samba to log these warnings:

[2011/03/02 21:58:50, 0] smbd/server.c:1069(main)
  smbd version 3.4.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009
[2011/03/02 21:58:50, 0] smbd/server.c:1115(main)
  standard input is not a socket, assuming -D option
[2011/03/02 21:58:50, 0] lib/smbldap.c:1086(smbldap_connect_system)
  failed to bind to server ldap://10.23.0.42 with dn="cn=admin,dc=wolf,dc=intern" Error: Can't contact LDAP server
        (unknown)
[2011/03/02 21:58:50, 1] lib/smbldap.c:1265(another_ldap_try)
  Connection to LDAP server failed for the 1 try!
[2011/03/02 21:58:51, 1] lib/smbldap.c:1265(another_ldap_try)
  Connection to LDAP server failed for the 2 try!

after that no further errors are logged and smbd is running but not responding to any requests. A

service smdb restart

fixes the problem but it will reoccur on each reboot. for now, we have found a workaround: simply added

sleep 5 ; service smbd restart

to /etc/rc.local but this of course does not fix the underlying problem. Any advice?

samba version: 2:3.4.7~dfsg-1ubuntu3.4

James Page (james-page)
tags: added: lucid
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Slu, thanks for taking the time to file this bug and help us make ubuntu better.

You don't mention what version you were on before. The start condition for smbd has been the same since Feb of last year:

samba (2:3.4.5~dfsg-2ubuntu2) lucid; urgency=low

  * Switch smbd and nmbd over to upstart jobs, to ensure nmbd starts reliably
    after the network is up. LP: #523868.
  * Remove /etc/network/if-up.d/samba on upgrade, superseded by the above.

 -- Steve Langasek <email address hidden> Thu, 18 Feb 2010 12:51:45 +0000

smbd is started as soon as local-filesystems is emitted by mountall, which is very early in the boot.

To fix this issue on lucid, we could very easily add an upstart job to the slapd package which removes it from the sysvinit startup and starts it before smbd:

# slapd-before-samba
start on starting smbd
task
script
  update-rc.d slapd remove || :
  update-rc.d slapd stop 70 0 1 6 .
  exec /etc/init.d/slapd start
end script

Of course, even better would be to simply create an upstart job for slapd which can define starting smbd as its start criteria (or even better, start on starting NEEDS_LDAP=1 and then export that in smbd and other services' upstart job definitions).

This sounds like its been the case since 10.04 was released though, so I'm not sure what the importance should be. For now I'm going to mark this as Triaged and Medium, as this sounds like a new accidental regression for a limited set of users (who run their slapd and smbd on the same box). If you could please confirm that this was caused by an upgrade from hardy or karmic to lucid, that would help (and would warrant tagging this bug hardy2lucid or karmic2lucid). It doesn't make any sense that any of the lucid updates would cause it.

The key is that slapd is explicitly started at level 19 in the sysvinit sequence. This seems deliberate, since it is common for slapd to support other services locally. Since samba has been moved out of the sysvinit sequence, to make it depend on slapd one must do something like above.

This is similar to bug #445619 which documents the same effect for kerberos servers which depend on slapd

In summary, marking Triaged, setting importance to Medium. Also adding openldap task since this really has to be fixed there, though it might be worked around in samba for SRU's.

tags: added: upstart
Changed in samba (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in openldap (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
tags: added: regression-release
Revision history for this message
Samuel Wolf (samuel-wolf) wrote :

Hello Clint,

yes the server was upgraded!

Originally installed on Ubuntu 7.10 and upgrade to Ubuntu Server 8.04, five weeks ago we upgrade than to Ubuntu 10.04.

Revision history for this message
Samuel Wolf (samuel-wolf) wrote :

After upgrade of the following packages today
"libpam-smbpass libwbclient0 linux-image-server linux-libc-dev linux-server samba samba-common samba-common-bin samba-doc smbclient smbfs tzdata tzdata-java winbind"
I must restart the samba server as well.

tags: added: hardy2lucid
Revision history for this message
Ro (robert-markula) wrote :

Vanilla install on Lucid 10..04.3 here, still the same issue.

Changed in openldap (Ubuntu Lucid):
status: New → Confirmed
Changed in openldap (Ubuntu Maverick):
status: New → Confirmed
Changed in samba (Ubuntu Lucid):
status: New → Confirmed
Changed in samba (Ubuntu Maverick):
status: New → Confirmed
Revision history for this message
datakid (datakid) wrote :

+! Vanilla install, issue seen. Although I can't get slapd to restart at all.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

maverick has seen the end of its life and is no longer receiving any updates. Marking the maverick task for this ticket as "Won't Fix".

Changed in openldap (Ubuntu Maverick):
status: Confirmed → Won't Fix
Changed in samba (Ubuntu Maverick):
status: Confirmed → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in openldap (Ubuntu Lucid):
status: Confirmed → Won't Fix
Changed in samba (Ubuntu Lucid):
status: Confirmed → Won't Fix
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.