Samba starts before static IPs set in network manager, even when only using 'interfaces' and not 'bind interfaces only'

Bug #836849 reported by camden lindsay
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

dylan@strut-google-server:/var/log/samba$ lsb_release -rd
Description: Ubuntu 10.04.3 LTS
Release: 10.04

_______________________________

dylan@strut-google-server:/var/log/samba$ apt-cache policy samba
samba:
  Installed: 2:3.4.7~dfsg-1ubuntu3.7
  Candidate: 2:3.4.7~dfsg-1ubuntu3.7
  Version table:
 *** 2:3.4.7~dfsg-1ubuntu3.7 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
        100 /var/lib/dpkg/status
     2:3.4.7~dfsg-1ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
_____________________________________

Expect that samba will start up provided the interface assigned in it's config has a static IP address.

Instead, Samba starts before the network manager manages to set up the static IP address on the machine.
See attached log file.

Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi camden. This seems to be addressed in Ubuntu 10.10 and later with a script called /etc/network/if-up.d/samba .

However, a snafu may have prevented this fix from entering lucid yet.. causing a bit of confusion. As such, this seems to be a duplicate of bug #462169, and I'm marking it as such. It should be relatively easy to fix.

Revision history for this message
Steve Langasek (vorlon) wrote :

Bug #462169 is about nmbd startup, not smbd startup.

Please attach the /etc/smb.conf and /var/log/samba/log.smbd from this system, so we can see exactly what's happening on your system. By default, smbd should start up without error before the interfaces are available, and attach to them when they become available.

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ok, after some discussion with Steve it appears this is unrelated to bug #462169, and its only by mistake that /etc/network/if-up.d/samba is even shipped.

It would appear that the currently supported way to bind samba to a specific interface is to also change /etc/init/smbd.conf to be

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

So that you can guarantee that it does not start until that specific interface is up and ready.

Another option is to use

interfaces = ethX

instead of binding to a specific IP, so that smbd will just poll that inteface and "just work" when it does get an IP.

Either way, it seems that smbd is doing the right thing in your situation, but your configuration isn't supportable in the generic sense. So unless we're missing something, you probably just need to change /etc/init/smbd.conf to wait for the specific interface.

Closing as Invalid. Please feel free to re-open it by changing the status to New if you have more information, or open a new bug report if you feel that this one does not capture your problem appropriately. Thanks for the report as well!

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :

Okay, let me see if i can touch on all of your points here.

I do not have IFACE=eth0 in the "start on' clause of /etc/init/smb.conf

However, i do have the following line in /etc/samba/smb.conf, and it does not 'just work' as you indicate it should, unfortunately. :(
interfaces = eth0

Note that this bug is the same as https://bugs.launchpad.net/ubuntu/+source/samba/+bug/374589 essentially.

Attached are single startup /var/log/samba/log.smbd, /var/log/samba/log.nmbd, and /etc/samba/smb.conf, as well as a successful startup of smbd after the system is up and running.

Note the following in log.smbd:

[2011/09/03 01:45:29, 2] lib/interface.c:389(interpret_interface)
  interpret_interface: Can't find address for eth0
[2011/09/03 01:45:29, 0] lib/interface.c:550(load_interfaces)
  WARNING: no network interfaces found
[2011/09/03 01:45:29, 0] smbd/server.c:1115(main)
  standard input is not a socket, assuming -D option
[2011/09/03 01:45:29, 0] smbd/server.c:616(open_sockets_smbd)
  open_sockets_smbd: No sockets available to bind to.
[2011/09/03 01:45:29, 0] smbd/server.c:837(exit_server_common)
  ===============================================================
[2011/09/03 01:45:29, 0] smbd/server.c:839(exit_server_common)
  Abnormal server exit: open_sockets_smbd() failed
[2011/09/03 01:45:29, 0] smbd/server.c:840(exit_server_common)
  ===============================================================
[2011/09/03 01:45:29, 0] lib/util.c:1584(log_stack_trace)
  BACKTRACE: 6 stack frames:
   #0 smbd(log_stack_trace+0x1a) [0x7fd9fbc2695a]
   #1 smbd(+0x5a9f90) [0x7fd9fbeb5f90]
   #2 smbd(+0x5aa161) [0x7fd9fbeb6161]
   #3 smbd(main+0x90d) [0x7fd9fbeb6ebd]
   #4 /lib/libc.so.6(__libc_start_main+0xfd) [0x7fd9f83b3c4d]
   #5 smbd(+0xc0a49) [0x7fd9fb9cca49]
[2011/09/03 01:45:29, 0] lib/fault.c:326(dump_core)
  dumping core in /var/log/samba/cores/smbd

Changed in samba (Ubuntu):
status: Invalid → New
Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :
Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :
Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :

log.smbd after machine and interface are up, running service smdb start

Robie Basak (racb)
Changed in samba (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Robie Basak (racb) wrote :

Manually editing interfaces in smb.conf currently requires a manual change to /etc/init/smb.conf also. This is the same issue as bug 823878 (see https://bugs.launchpad.net/ubuntu/+source/samba/+bug/823878/comments/4), so I'm marking it as a duplicate.

Steve Langasek (vorlon)
summary: - Samba starts before static IPs set in network manager
+ Samba starts before static IPs set in network manager, even when only
+ using 'interfaces' and not 'bind interfaces only'
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
Robie Basak (racb) wrote :

The last time I looked at this, I missed that Clint had already marked this Invalid.

Camden, you say:
> I do not have IFACE=eth0 in the "start on' clause of /etc/init/smb.conf

Note that this is required. If you choose to edit /etc/samba/smb.conf manually to add an "interfaces" entry, you MUST also adjust /etc/init/smb.conf if you're using Network Manager.

As Clint said, I don't see a generic way of avoiding this requirement, but also see it as acceptable that you understand how to edit configuration files manually if you choose to edit configuration files manually.

So, realistically, this isn't going to change, unless someone else wants to propose a path forward in technical terms. It's either a Wishlist, or Won't Fix, or both. I think that keeping this bug open is misleading, so I'm marking it as Won't Fix.

Changed in samba (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
camden lindsay (camden-lindsay+launchpad) wrote :

Thank you, Clint.

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.