Jump to content

Photo

Samba crashes on boot, works if restarted

- - - - -

6 replies to this topic

#1
dkg

dkg

    Member

  • Members
  • PipPip
  • 19 posts

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.



#2
stac80

stac80

    Member

  • Members
  • PipPip
  • 12 posts

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.



#3
dkg

dkg

    Member

  • Members
  • PipPip
  • 19 posts

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.



#4
stac80

stac80

    Member

  • Members
  • PipPip
  • 12 posts

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.



#5
666threesixes666

666threesixes666

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

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....a/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.


Duke: No more of that talk or I'll put the f*cking leeches on you, understand?

 

Paul: [about Percy] The man is mean and careless and stupid, and that's a bad combination in a place like this.


#6
dkg

dkg

    Member

  • Members
  • PipPip
  • 19 posts

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.



#7
dkg

dkg

    Member

  • Members
  • PipPip
  • 19 posts

So, I've added a 'sleep 10s' to /etc/init.d/samba, which works.  Still hoping for a better solution.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users