Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So when I first boot or reboot, smbd and nmbd are running but my shared folders aren't available. After a

sudo service smbd restart

everything is fine. My configuration is simple, using the local workgroup without winbind and there aren't any errors in log.(s|n)mbd.

Any ideas on how I can get rid of this additional restart?

Here's my smb.conf and I'm not sharing from a home dir or an encrypted partition.


[global]

   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)
   dns proxy = no

interfaces = lo eth0
hosts allow = 127.0.0.1 192.168.1.0/24 192.168.2.0/24
bind interfaces only = true
client ntlmv2 auth = yes

   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d

security = share
guest account = nobody

   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes

   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s* ...
   pam password change = yes
   map to guest = bad user

   usershare allow guests = yes

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[Media]
    comment = Media 
    path = /media/archive_a
    browseable = no 
    read only = yes
    guest ok = yes

[Firefly]
    comment = Firefly 
    path = /usr/local/firefly
    browseable = no 
    read only = no
    guest ok = yes
share|improve this question
    
Please add your configuration to your question, also do you share any folders from inside your home folder? Is it encrypted? –  Bruno Pereira Feb 26 '12 at 21:52

2 Answers 2

You have changed /etc/samba/smb.conf to have smbd bind to a specific interface.

interfaces = lo eth0
bind interfaces only = true

Therefore you also need to edit /etc/init/smbd.conf to ensure that smbd starts only after that your interface is up as described in https://bugs.launchpad.net/ubuntu/+source/samba/+bug/771305/comments/17

so, edit /etc/init/smbd.conf and change

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

with

start on (local-filesystems and net-device-up IFACE=eth0 and started udev-finish)
share|improve this answer
    
Thanks! This is the correct answer! –  MetaChrome Feb 8 at 14:30

hmmm I know it is a hack, but can't you do the additional restart in a startup script, until you got the final answer? =D just my 2 bits..

share|improve this answer
    
Ah, the eternal conflict ... put more time into finding a "real" solution or just hack the f****** thing :) –  user47015 Feb 27 '12 at 1:12
    
Hey, I already pointed this out... Just a hack until he/us find a real solution. @Jaguar0616 –  H_7 Feb 29 '12 at 12:14
    
No offense meant, I appreciated the reply. Doing the extra restart in a script is exactly what I'm doing right now, still haven't found the underlying cause of the problem. –  user47015 Feb 29 '12 at 19:15
    
@Jaguar0616 Nice Jaguar. Maybe my answer should be a comment, no upvotes for it... =/ –  H_7 Mar 3 '12 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.