Jump to content
funtoo forums
  • 0
dkg

Samba crashes on boot, works if restarted

Question

I have a problem with samba on a file server that's been happening for a while, but just now having a closer look.  When I boot the server, about the only feedback I find is in /var/log/samba/log.smbd:

[2015/03/16 13:31:49,  0] smbd/server.c:1072(main)
  smbd version 3.6.25 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011

So, everything seems fine, but the shares are unresponsive.  So I check status:

# /etc/init.d/samba status
 * status: crashed

And then this shows up in /var/log/messages:

Mar 16 13:33:04 wolfie /etc/init.d/samba[3616]: status: crashed

But there are actually smbd processes running:

# ps u -C smbd
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3216  0.0  0.1  49376  7172 ?        Ss   13:31   0:00 /usr/sbin/smbd -D
root      3235  0.0  0.1  49376  4452 ?        S    13:31   0:00 /usr/sbin/smbd -D

So I restart:

# /etc/init.d/samba restart
 * samba -> stop: smbd ...                                                                                                                     [ ok ]
 * samba -> stop: nmbd ...
 * start-stop-daemon: no matching processes found                                                                                              [ ok ]
 * samba -> start: smbd ...                                                                                                                    [ ok ]
 * samba -> start: nmbd ...
# /etc/init.d/samba status
 * status: started
# ps u -C smbd
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3761  0.0  0.1  49376  7308 ?        Ss   13:41   0:00 /usr/sbin/smbd -D
root      3764  0.0  0.1  49376  4348 ?        S    13:41   0:00 /usr/sbin/smbd -D

At this point, everything works.  Any thoughts on how to get this working on boot?

 

The box is funtoo-stable running in a VirtualBox VM using a virtio-net bridged adapter and dhcpcd (static reservation), samba 3.6.25, gentoo-sources-3.18.7.

 

Thanks.

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I had this problem a while back. It stemmed from the fact that the network was not coming up before the samba server tried to start. It turned out that the zero configuration set up (dhcpcd) was taking too long.

 

My solution was to create a static ip network configuration via the Funtoo networking configuration system. (http://www.funtoo.org/Networking)

 

My server is not in a VM though so I don't know if this is relevant to you or not but hopefully this points you in the right direction.

Share this post


Link to post
Share on other sites
  • 0

I'm using dhcpcd so that the (static) IP address is assigned by the dhcp server which also handles DNS.  That way, I only have to manage the IPs and names in one place.  I forgot to mention that this configuration used to work fine.  The problem may have started after an upgrade of the router (running OpenWRT which handles dhcp), but I'm not positive.  Anyway, it ought to be fixable on the funtoo server.

Share this post


Link to post
Share on other sites
  • 0

I had the same issue. Everything worked for a long time with dhcpcd getting its IP from my DD-WRT router, which also handled all the DNS for my lan; including handing out a "static" IP to my server. I honestly don't know what changed either. I generally don't reboot too often so many updates had happened in the interim making it unlikely I was going to be able to track down the exact change that caused the problem. The solution that worked for me, once I realised samba was failing because it wasn't getting an IP early enough, was with the Funtoo networking config assigning my IP address during boot before samba gave up and failed.

 

This is what I have in my /etc/conf.d/netif.eth0:

template="interface"

ipaddr="192.168.145.22"

gateway="192.168.145.1"

nameservers="...."

domain="server.me.lan"

 

But like you said, it might be your upgrade of OpenWRT that did it.

Share this post


Link to post
Share on other sites
  • 0

i hate to say this but when i have samba problems, its been from stale configs clashing with new versions....  so i completely remove everything that has anything to do with samba in the configs and so forth then emerge the exact version and let it populate the new configs.  i then merge in backed up configurations for directories and share names etc....  i don't have any samba documentation @ funtoo yet...  i've been busy taking a relaxed pace at doing these things....

 

there is some good information from https://wiki.gentoo.org/wiki/Sambahttps://wiki.gentoo.org/wiki/Samba/Configuration  

 

however that documentation's a mess that needs to be sorted down, and processed.  we should start rolling a samba page.  i need to note how to track wiki changes via watch feature.  it will make it so people that use and are interested in the package can keep the documentation for it high quality.

 

 

the symptoms your describing i have seen and resolved using the scorched earth method a few times when i was building documentation for gentoo.  mysql also leaves some stale files that can funk and fight new installs under gentoo/funtoo and requires scorched earth to start from square 1.

Share this post


Link to post
Share on other sites
  • 0

the symptoms your describing i have seen and resolved using the scorched earth method a few times when i was building documentation for gentoo.

 

That's not a bad idea, but my smb.conf file is practically empty.  It has the bare minumum to set up one file share (10 lines).  There's nothing to rebuild.  I suppose I just need to put samba on a delayed start, but I don't know how to do that without pausing the whole boot process.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×