Gentoo & Samba hanging boot and refusing to start

I recently took a server from for maintenance (PSU burned down) and quickly noticed it hung at boot (hangs at Samba starting).

I went into interactive boot mode and skipped Samba.

Thinking it was a networking issue (server has static IP & routing set up) which didn’t match my home network.

Set up dhcp, changed the gateway, and started restarting samba from command line.

It always resulted in something like this:

BroServ ~ # /etc/init.d/samba restart
 * samba -> start: smbd ...
**** HANGS INDEFINITELY **** 
^C * * samba: caught SIGINT, abortingstart-stop-daemon: caught SIGINT, aborting [ !! ]v ~ # * samba -> start: nmbd ... * start-stop-daemon: /usr/sbin/nmbd is already running [ !! ] * Error: starting services (see system logs) * samba -> stop: smbd ... [ ok ] * samba -> stop: nmbd ...

Could cancel it with ctrl + c (which I couldn’t do at boot).

Tried to recompile CUPS & Samba. Upgraded kernel from 2.6.30 to 3.3.8. Always kept hanging. Google wasn’t really helpful. Many people experienced Samba hanging boot process, but there was never one solution to the problem.

The logs showed something along these lines:

[2012/08/04 16:37:47, 0] smbd/server.c:1141(main)
 smbd version 3.5.15 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2010
[2012/08/04 16:37:47.783423, 0] param/loadparm.c:7668(lp_do_parameter)
 Global parameter guest account found in service section!
[2012/08/04 16:37:47.783520, 0] param/loadparm.c:7668(lp_do_parameter)
 Global parameter guest account found in service section!

Which basically didn’t say much except something about guest account being in the Global section of the config. But at the same time, it had worked for eons before.

However, I went to take a look at noticed this in the Global section:

guest ok = yes

And removed it from that section and restarted Samba:

BroServ ~ # ps aux | grep smb
root 2990 0.0 0.0 4064 576 pts/1 S+ 16:37 0:00 tail -f /var/log/samba/log.smbd
root 3026 0.0 0.0 6368 716 pts/0 S+ 16:38 0:00 grep --colour=auto smb
BroServ ~ # ps aux | grep nmb 
root 2729 0.0 0.0 44008 2736 ? Ss 16:25 0:00 /usr/sbin/nmbd -D
root 3028 0.0 0.0 6368 716 pts/0 S+ 16:38 0:00 grep --colour=auto nmb
BroServ ~ # kill -9 2729
BroServ ~ # ps aux | grep nmb
root 3030 0.0 0.0 6368 712 pts/0 S+ 16:38 0:00 grep --colour=auto nmb
BroServ ~ # /etc/init.d/samba restart 
 * samba -> start: smbd ... [ ok ]
 * samba -> start: nmbd ... [ ok ]
BroServ ~ # /etc/init.d/samba restart
 * samba -> stop: smbd ... [ ok ]
 * samba -> stop: nmbd ... [ ok ]
 * samba -> start: smbd ... [ ok ]
 * samba -> start: nmbd ... [ ok ]
BroServ ~ # /etc/init.d/samba restart
 * samba -> stop: smbd ... [ ok ]
 * samba -> stop: nmbd ... [ ok ]
 * samba -> start: smbd ... [ ok ]
 * samba -> start: nmbd ... [ ok ]
BroServ ~ #

Odd, as the log still shows the same error line:

[2012/08/04 16:38:29, 0] smbd/server.c:1141(main)
 smbd version 3.5.15 started.  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2012/08/04 16:38:29.491274, 0] param/loadparm.c:7668(lp_do_parameter)
 Global parameter guest account found in service section! 
[2012/08/04 16:38:29.491343, 0] param/loadparm.c:7668(lp_do_parameter)
 Global parameter guest account found in service section!

But at least it’s starting up now…

So, what have we learned? Config mistakes can hang Samba and it will result in almost no output to the logs whatsoever.

Leave a Reply...