[SOLVED] samba needs a restart after a system restart
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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
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
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.
[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.
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?
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.
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?
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?
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...
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.