LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-29-2016, 11:15 PM   #1
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Rep: Reputation: 56
samba needs a restart after a system restart


not sure what's going on, but after restarting my machine running Slackware64 14.2 I always have to run a manual /etc/rc.d/rc.samba restart before anyone Windows machines can see my machine. between machines, we can both ping each other and 'smbclient -L localhost' does show the other Windows machine, but it won't browse to my samba server. any suggestions? I've disabled the firewall on both machine, but no change. below is my smb.conf

Code:
[global]
  workgroup = workgroup
  bind interfaces only = yes
  interfaces = lo bond0 eth0 eth1 wlan0
  hosts allow = 192.168.200.0/255.255.255.0 127.0.0.1
  printcap name = /etc/printcap
  load printers = yes
  printing = lprng
  log file = /var/log/samba/%m.log
  max log size = 50
  security = user
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  username map = /etc/samba/smbusers
  map to guest = Bad User
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  dns proxy = no 
  local master = no
  domain master = no
  preferred master = no
  wins proxy = yes
  name resolve order = lmhosts, host, wins, bcast
  follow symlinks = yes
  wide links = yes
  unix extensions = no

[the_one]
  comment = /mnt/spares/1 folder (read-only)
  path = /mnt/spares/1
  read only = yes
  public = yes
 
Old 11-29-2016, 11:40 PM   #2
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
I'm not familiar with Slackware, so forgive my ignorance. Is samba enabled on startup scripts/runlevels? What does the samba log says?
 
Old 11-30-2016, 01:25 AM   #3
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Do you have virtual machines running? Are their interfaces up when Samba starts? Is bond0 up when samba starts?
 
Old 11-30-2016, 06:39 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
It's possible that the shared directory hasn't been mounted yet. Is /mnt/spares/1 a normal harddrive/partition or a network mount?

I'd definitely follow C0wb0y's suggestion of checking the log files under /var/log/samba/ and see if you see any obvious errors.
 
Old 11-30-2016, 07:15 AM   #5
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by c0wb0y View Post
I'm not familiar with Slackware, so forgive my ignorance. Is samba enabled on startup scripts/runlevels? What does the samba log says?
yep, samba is enabled via startup scripts. the samba logs are below. everything else in the log directory are zero byte files

Quote:
Originally Posted by gezley View Post
Do you have virtual machines running? Are their interfaces up when Samba starts? Is bond0 up when samba starts?
I do have virtual machines running. the Windows machine itself is a virtual machine on the same Linux machine so samba actually starts prior to the virtual machines ever get a chance to start up, as well as their interfaces. bond0 is actually no longer used at the moment, only eth1... I threw in the other interfaces to cover my bases in case things changed.

Quote:
Originally Posted by bassmadrigal View Post
It's possible that the shared directory hasn't been mounted yet. Is /mnt/spares/1 a normal harddrive/partition or a network mount?

I'd definitely follow C0wb0y's suggestion of checking the log files under /var/log/samba/ and see if you see any obvious errors.
/mnt/spares/1 is a partition that's mounted at startup... thing is, the Windows VM can't even see the Linux machine on the network not to mention the shared folder... it can however ping each other by IP.

nmbd.log
Code:
[2016/11/29 22:47:02.422619,  0] ../lib/util/become_daemon.c:135(daemon_status)
  STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
[2016/11/29 22:47:07.439310,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections
smbd.log
Code:
[2016/11/29 22:47:02.405023,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
 
Old 11-30-2016, 01:02 PM   #6
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
I used to have this problem. Samba would bale out because the VMs with their virtual NICs weren't up at this stage. I solved it by starting Samba from rc.local.
 
Old 11-30-2016, 01:58 PM   #7
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Quote:
[2016/11/29 22:47:02.422619, 0] ../lib/util/become_daemon.c:135(daemon_status)
STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
This is pretty indicative. It appears that IPv4 is unavailable. How does the samba VM gets an IP, is it via DHCP?
Instead of indicating an interface, I would use an IP-based restriction such as:

Code:
interfaces = 192.168.200.1/24
bind interfaces only = yes
Then restart the machine. If it still did not resolve the issue, I would NOT restart the samba immediately. Check if smbd and nmbd are indeed not listening.

If still requires you to issue a restart, it has something to do with IP address being unavailable.
 
Old 11-30-2016, 09:24 PM   #8
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by c0wb0y View Post
This is pretty indicative. It appears that IPv4 is unavailable. How does the samba VM gets an IP, is it via DHCP?
Instead of indicating an interface, I would use an IP-based restriction such as:

Code:
interfaces = 192.168.200.1/24
bind interfaces only = yes
Then restart the machine. If it still did not resolve the issue, I would NOT restart the samba immediately. Check if smbd and nmbd are indeed not listening.

If still requires you to issue a restart, it has something to do with IP address being unavailable.
so I've changed my interfaces to what you've mentioned and restarted, but it did not resolve... the logs look exactly as what I posted previously after this change regarding no local IPv4 non-loopback interfaces being available. looks like running rc.samba from rc.local mentioned by gezley is the only option? I am using NetworkManager to deal with my network connections if that makes any difference?
 
Old 11-30-2016, 09:32 PM   #9
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
It appears that NetworkManager is handling your IP assignment, maybe via DHCP even. Are you able to statically-assigned an IP to samba interface, at least? In some distros, you can restrict NetworkManager not to touch specific interfaces. I'm not sure how to do that in Slackware.
 
Old 11-30-2016, 10:50 PM   #10
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by c0wb0y View Post
It appears that NetworkManager is handling your IP assignment, maybe via DHCP even. Are you able to statically-assigned an IP to samba interface, at least? In some distros, you can restrict NetworkManager not to touch specific interfaces. I'm not sure how to do that in Slackware.
do you mean assign a static IP to the interface that samba uses, which is effectively the interface used for the Internet/LAN on this machine? if that is the case, then my router is already assigning this interface a static IP address even though it's DHCP. is that not good?
 
Old 12-01-2016, 11:07 PM   #11
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Yes, if you can assign an static IP so that when samba starts there is already an IP waiting. Or maybe rearrange startup scripts, if that is even possible?
 
Old 12-03-2016, 11:01 PM   #12
dimm0k
Member
 
Registered: May 2008
Location: Brooklyn ZOO
Distribution: Slackware64 14.2
Posts: 564

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by c0wb0y View Post
Yes, if you can assign an static IP so that when samba starts there is already an IP waiting. Or maybe rearrange startup scripts, if that is even possible?
so I've tried re-arranging when samba starts to the end of the boot up process so that it happens right before I log in, but still no fix! I can ping the outside world, 8.8.8.8, with no problems, but I still see in the nmbd.log that when samba started it was still having issues with the IPv4 non-loopback interface. looking more into this it looks like NetworkManager might not be fully up by the time samba is ready to serve... need to figure out how to get samba hooked into NetworkManager somehow...
 
Old 12-04-2016, 10:18 AM   #13
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,308

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
I'm just lazy hack not wanting to fool with wicd or networkmanager. I had similar problem, on the wifi computers found out wifi was not starting before samba, in /etc/rc.d/rc.M I put wifi start up script after
# Initialize the networking hardware. and before # Start D-Bus:
 
Old 12-04-2016, 12:52 PM   #14
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Try creating a script (maybe called restart-samba.sh) in /etc/NetworkManager/dispatcher.d/ and have it contain the following:

Code:
if [ "$2" = "up" ]; then  
       /etc/rc.d/rc.samba restart  
fi  
exit $?
Make sure it is not writeable by group or other and that it is executable by root.

Code:
chmod 744 /etc/NetworkManager/dispatcher.d/restart-samba.sh
Now, if this works as I think it should, once a connection is made, NM should automatically restart your samba server.
 
Old 12-04-2016, 01:44 PM   #15
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Not sure how you can make an exclusion in NM on Slackware. In Redhat and its variants, you can add 'NM_CONTROLLED=no' and an static IP assignment.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM
restart samba jfranks214 Linux - Newbie 6 03-28-2004 06:47 PM
Can't restart My samba AndreL Linux - Newbie 6 03-24-2004 09:24 PM
How can I restart Samba? Spowy Linux - Newbie 2 09-15-2003 05:59 PM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration