Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba crashes on startup [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tom_
Guru
Guru


Joined: 20 May 2004
Posts: 395
Location: France

PostPosted: Mon May 21, 2012 6:05 pm    Post subject: Samba crashes on startup [solved] Reply with quote

Hi,
I have got a problem for a while with Samba on my Gentoo workstation. Sometimes Samba doesn't start and appears to have crashed according to the init script.
thomas@gentoo ~ % sudo /etc/init.d/samba status
Mot de passe :
* status: crashed

When Samba crashes on startup, I have the following error in Samba log :
[2012/05/21 18:07:35, 3] ../lib/util/util_net.c:70(interpret_string_addr_internal)
interpret_string_addr_internal: getaddrinfo failed for name 0.0.0.0 [Address family for hostname not supported]
[2012/05/21 18:07:35, 0] nmbd/nmbd.c:689(open_sockets)

As the Samba init script is run after the net script, I guess that this issue happens only when it takes too long to get an IP address (DHCP).

I would like to stick with dhcp but I wonder if I can configure Samba to start only when I have proper IP address ?

Thanks


Last edited by Tom_ on Fri Jan 31, 2014 2:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
honp
Guru
Guru


Joined: 25 Sep 2006
Posts: 355
Location: Good old Prague, Czech rep.

PostPosted: Tue May 22, 2012 2:25 pm    Post subject: Reply with quote

Try it with static ip and hostname, than with dhcp.
Back to top
View user's profile Send private message
popsUlfr
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2011
Posts: 80

PostPosted: Tue May 22, 2012 2:58 pm    Post subject: Reply with quote

Yeah that issue was pretty annoying. What I did was creating a hacky script
Code:

#!/bin/sh
sleep 10 && /etc/init.d/samba start &

which I called 'sambadelayed.start' and dropped in my '/etc/local.d' directory (and chmod +x of course).
Finally I removed samba from the default runlevel. No issues so far :)

If you're using NetworkManager you may look into creating a dispatcher script (much cleaner!)
Code:

#!/bin/sh

INTERFACE=${1} # the interface that's brought up or down
STATUS=${2} # state 'up' or 'down'

case "${STATUS}" in
   'up') # the case where a connection can be established
      exec /etc/init.d/samba start
      ;;
   'down')
      # do something when connection gets lost?
      # exec /etc/init.d/samba stop
      ;;
esac

name it '10-samba' or something and drop it into /etc/NetworkManager/dispatcher.d' (don't forget to chmod +x !!)

Samba should only be started now once a connection could be established now.

By the way there are pretty good tips on speeding up dhcp and more on the arch wiki page: https://wiki.archlinux.org/index.php/NetworkManager#Network_Services_with_NetworkManager_Dispatcher
Back to top
View user's profile Send private message
Tom_
Guru
Guru


Joined: 20 May 2004
Posts: 395
Location: France

PostPosted: Wed May 23, 2012 7:45 pm    Post subject: Reply with quote

I disabled ARP probing in dhcpcd as advised on the Arch wiki. This solves my problem for the moment.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum