Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got an Ubuntu server. I installed Samba to share files with Windows clients and it started off fine. I recently added some shares that are based on UnionFS and now the samba server will not start at boot and I have to launch it manually (/etc/init.d/samba start works without error)

It's annoying and it's going to cause problems when the server gets restarted when I'm not there. Can anybody suggest an idea why it's not booting and/or give me a way to make sure it does.

Edit: Just restarted. Here's the log for the boot-up.

[2009/05/15 10:04:21,  0] smbd/server.c:main(1260)
  smbd version 3.3.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009
[2009/05/15 10:04:21,  0] printing/print_cups.c:cups_connect(103)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2009/05/15 10:04:21,  0] printing/print_cups.c:cups_connect(103)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2009/05/15 10:04:21,  0] lib/interface.c:load_interfaces(546)
  WARNING: no network interfaces found
[2009/05/15 10:04:22,  0] smbd/server.c:open_sockets_smbd(554)
  open_sockets_smbd: No sockets available to bind to.

I realise I need to clean out some CUPS nonsense.. The "no network interfaces" part is really odd because it will start up (albeit manually).

Here's the log when I run /etc/init.d/samba start

[2009/05/15 10:09:03,  0] smbd/server.c:main(1260)
  smbd version 3.3.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009

No grief about CUPS. No moaning about network interfaces. No nagging about sockets. How I like it.

share|improve this question
    
Just looking at those logs, could it be the network adapter not being connected before samba starts? I'm specifying it in the conf. I'll turn that off and give it another go. –  Oli May 15 '09 at 9:15
add comment

3 Answers

up vote 2 down vote accepted

Have you checked to see that you have all these links ?

/etc/rc5.d/S20samba
/etc/rc4.d/S20samba
/etc/rc3.d/S20samba
/etc/rc2.d/S20samba

If not, then samba is not set to autostart, and you should set it up to do so with something like :

update-rc.d samba defaults

Edit:

Ok, so what is reported in the log files around system start up time ?

/var/log/samba/log.smbd
/var/log/samba/log.nmbd

check those two and see if there's anything suspicious in there.

share|improve this answer
    
Yeah they already exist. I ran the command anyway but just got: "System startup links for /etc/init.d/samba already exist." –  Oli May 15 '09 at 8:34
    
Edited to show logs. –  Oli May 15 '09 at 9:10
    
I'm accepting this answer as it is most likely going to fix things for the next person that comes in this thread with a faulty samba set up. –  Oli May 15 '09 at 9:34
add comment

I recently added some shares that are based on UnionFS and now the samba server will not start at boot and I have to launch it manually

When and how do these UnionFS things get mounted? Are they all done in the /etc/fstab, or do you have some script that mounts them. The important question is are they mounted before the system attempts to start Samba?

share|improve this answer
    
Very good point, I'd not thought of that. –  GodEater May 15 '09 at 8:47
    
They're mounted in fstab so I can't see how they'd not be mounted by the time samba was loading. –  Oli May 15 '09 at 8:58
add comment

Well... Bother.

I turned out that the whole problem was caused by me binding to an interface that (apparently) isn't set up until after Samba starts.

Sorry for all the red herrings and thank you both for your answers.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.