Samba non-functional on boot.

Bug #951087 reported by darkphader
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Even though nmbd and smbd are running after boot, Samba service is unavailable.
===========================
ps axf |grep mbd
2467 ? Ss 0:00 smbd -F
2469 ? S 0:00 \_ smbd -F
2478 ? Ss 0:00 nmbd -D
===========================

Samba does not allow connections from other systems and nmap from another system does not list ports 139 and 445 as open.

Restarting both nmbd and smbd after boot makes Samba service available and nmap now shows ports open:
===========================
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
===========================

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: samba 2:3.6.3-1ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Fri Mar 9 14:35:50 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
ProcEnviron:
 TERM=screen
 SHELL=/bin/bash
 PATH=(custom, no user)
SourcePackage: samba
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
darkphader (chris-realcomputerguy) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

What does 'netstat -l' say, does it list anything for smbd and nmbd?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Sorry, 'netstat -lp'

Revision history for this message
darkphader (chris-realcomputerguy) wrote : Re: [Bug 951087] Re: Samba non-functional on boot.

On Fri, Mar 9, 2012 at 3:16 PM, Jelmer Vernooij
<email address hidden> wrote:
> What does 'netstat -l' say, does it list anything for smbd and nmbd?

Yes.
=================================
# netstat -lp |grep mbd
tcp 0 0 localhost:netbios-ssn *:*
LISTEN 751/smbd
tcp 0 0 localhost:microsoft-ds *:*
LISTEN 751/smbd
udp 0 0 172.26.63.25:netbios-ns *:*
         1045/nmbd
udp 0 0 nicedog.kwla:netbios-ns *:*
         1045/nmbd
udp 0 0 *:netbios-ns *:*
         1045/nmbd
udp 0 0 172.26.63.2:netbios-dgm *:*
         1045/nmbd
udp 0 0 nicedog.kwl:netbios-dgm *:*
         1045/nmbd
udp 0 0 *:netbios-dgm *:*
         1045/nmbd
unix 2 [ ACC ] STREAM LISTENING 8679 1045/nmbd
        /var/run/samba/unexpected
=================================

Nmap from another system:
=================================
Nmap scan report<snip>
Not shown: 996 closed ports
PORT STATE SERVICE
21/tcp open ftp
631/tcp open ipp
=================================

After restarting nmbd and smbd:
=================================
# netstat -lp |grep mbd
tcp 0 0 localhost:netbios-ssn *:*
LISTEN 2058/smbd
tcp 0 0 nicedog.kwl:netbios-ssn *:*
LISTEN 2058/smbd
tcp 0 0 localhost:microsoft-ds *:*
LISTEN 2058/smbd
tcp 0 0 nicedog.kw:microsoft-ds *:*
LISTEN 2058/smbd
udp 0 0 172.26.63.25:netbios-ns *:*
         2050/nmbd
udp 0 0 nicedog.kwla:netbios-ns *:*
         2050/nmbd
udp 0 0 *:netbios-ns *:*
         2050/nmbd
udp 0 0 172.26.63.2:netbios-dgm *:*
         2050/nmbd
udp 0 0 nicedog.kwl:netbios-dgm *:*
         2050/nmbd
udp 0 0 *:netbios-dgm *:*
         2050/nmbd
unix 2 [ ACC ] STREAM LISTENING 12071 2050/nmbd
        /var/run/samba/unexpected
=================================

=================================
Nmap scan report<snip>
Not shown: 994 closed ports
PORT STATE SERVICE
21/tcp open ftp
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
=================================

However the problem only occurs when I use the following (valid syntax
and configuration) in smb.conf:
=================================
interfaces = 127.0.0.1 172.26.62.112
bind interfaces only = Yes
=================================
If I comment the above out and reboot Samba is live but it's not the
desired configuration.

Also even the more general syntax (again not the desired configuration) fails:
=================================
interfaces = lo eth0
bind interfaces only = Yes
=================================

Seems like a timing issue with Samba being brought up to early. Had a
similar issue with an earlier Ubuntu release that was never resolved.

Changed in samba (Ubuntu):
importance: Undecided → High
Revision history for this message
James Page (james-page) wrote :

The upstart configuration for samba makes the assumption that you are not using this configuration i.e. it assumes that samba will deal with binding to all interfaces.

It would be good to confirm this - please could you attach the log files for smbd and smbd from /var/log/samba to this bug report.

In the meantime you could try adding an override file for your specific configuration in /etc/init/smbd.override:

start on (local-filesystems and net-device-up IFACE=eth0)

This might help as the smbd daemon will then try to start a bit later once a real network interface starts up.

I'm downgrading this bug to 'Low' as its very specific to the way you are using samba and marking 'Incomplete' pending your response on the above.

Thanks

Changed in samba (Ubuntu):
importance: High → Low
status: New → Incomplete
Revision history for this message
darkphader (chris-realcomputerguy) wrote :

> The upstart configuration for samba makes the assumption that you are not using this configuration i.e. it assumes that samba will deal with binding to all interfaces.

It shouldn't do that.

> It would be good to confirm this - please could you attach the log files for smbd and smbd from /var/log/samba to this bug report.

level 10 logs forthcoming

> start on (local-filesystems and net-device-up IFACE=eth0)

That does help but shouldn't be necessary for such an important package. What if I was dealing with eth1 instead, then the line has to be edited. Plus is the override file guaranteed to work through various upgrades? If not then server stability is really in question.

> I'm downgrading this bug to 'Low' as its very specific to the way you are using samba and marking 'Incomplete' pending your response on the above.

Actually a pretty standard way to use Samba. And it's anything but "Low" when your Samba box is a PDC or file/print server for many users. Suggest this bug in Ubuntu finally get fixed.

Revision history for this message
darkphader (chris-realcomputerguy) wrote :
Revision history for this message
sundeep (xsundeep) wrote :

This is confirmed with a fresh install of Ubuntu 12.04 and vanilla samba shares. I agree with submitter, this is by no means a Low priority issue. I have implemented the override and will report results after the next reboot. This drove me around the bend trying to troubleshoot.

Separately, If the Ubuntu Gurus feel we should use samba differently, could they please tell us what the preferred method is?

Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for samba (Ubuntu) because there has been no activity for 60 days.]

Changed in samba (Ubuntu):
status: Incomplete → Expired
Revision history for this message
THCTLO (thctlo) wrote :

This bug should be reopend.

Not being able to set the interfaces in the samba config files is very bad.

I recommend everybody to skip Ubuntu and change to Debian instead.
This is not te way to handle Bugs reports.

There are lots op people use the interfaces setting.

What i you have 2-4-8 Nics and only 1 should use samba.

Ive had this problem on 5 server now, and all are running fine now with Debian Squeeze.

Ubuntu is slow compaired to debian, just the whole OS is slow, test is your self...

Changed in samba (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Miroslav Zaťko (mirec-z) wrote :

the bug is still here... confirmed again on fresh install of Ubuntu 12.04LTS
even "start on (local-filesystems and net-device-up IFACE=eth0)" did not help

Revision history for this message
Renne (renne) wrote :

This BUG is a SECURITY ISSUE!!!

Binding Samba to all interfaces/IPs is a NO-GO if the host has a public IP (in our case a PDC for multiple sites via VPN).

Ubuntu becomes a laughing-stock by classifying this as "low" priority.

If Ubuntu doesn't act, we'll file a CVE at Mitre!

Revision history for this message
Noble Pepper (noblepepper) wrote :

I have suffered this behavior through several versions of Ubuntu, I believe since at least Precise.

For me changing smbd.conf start condition from :

start on (local-filesystems and net-device-up)

to:

start on (local-filesystems and net-device-up IFACE!=lo)

takes care of it, seems rather simple, I don't see why anyone would want to run SAMBA on lo.

Revision history for this message
Adrien Beau (adrienbeau) wrote :

Note that instead of editing /etc/init/smbd.conf (which can mess up package upgrades), you can create a file named /etc/init/smbd.override and put the line there. Works fine for me, and solved the problem.

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.