Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[SOLVED] Only first device can connect to Samba after restart
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Solved: Only first device can connect to Samba after restart
23rd Jan, 2018, 07:13 AM
Post: #1
Dzintars Bergs
Unregistered
 
Only first device can connect to Samba after restart
Hi!

Lately I'm having problems with Samba. Only first device can connect to Samba (shared printer or folders) after restart. After the first device have connected, others are getting timeout. This happens on Windows 10, Mac OS and Android clients.

Any suggestions, how to solve this? I think, it started after upgrade to Strech. I did fresh install of latest Xbian, it didn't help.

Log:
Terminal
[2018/01/22 21:56:00.543039, 0] ../source3/smbd/process.c:339(read_packet_remainder)
read_fd_with_timeout failed for client 0.0.0.0 read error = NT_STATUS_CONNECTION_RESET.
[2018/01/22 21:56:00.544912, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:57:26.444669, 0] ../source3/smbd/process.c:339(read_packet_remainder)
read_fd_with_timeout failed for client 0.0.0.0 read error = NT_STATUS_CONNECTION_RESET.
[2018/01/22 21:57:26.446897, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:57:26.981456, 0] ../source3/smbd/smb2_server.c:553(smbd_smb2_request_create)
Invalid SMB packet: first request: 0x0001
[2018/01/22 21:57:54.322461, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:58:28.634564, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:58:29.447338, 0] ../source3/smbd/smb2_server.c:553(smbd_smb2_request_create)
Invalid SMB packet: first request: 0x0001
[2018/01/22 21:59:25.385365, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:59:30.760347, 0] ../lib/util/pidfile.c:146(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2018/01/22 21:59:31.386522, 0] ../source3/smbd/smb2_server.c:553(smbd_smb2_request_create)
Invalid SMB packet: first request: 0x0001


smb.conf:
Terminal
[global]
server string = PI2
guest ok = yes
security = user
socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535
registry shares = yes
syslog = 0
map to guest = bad user
workgroup = DZB
bind interfaces only = No
encrypt passwords = true
log level = 0
# smb ports = 445
unix extensions = No
wide links = yes

include = /etc/samba/user.conf
include = /etc/samba/shares.conf

shares.conf:
Terminal
[data]
path = /data
guest ok = no
read only = no
valid users = xbian
browseable = yes
veto files = /._*/.DS_Store/
delete veto files = yes

[printers]
comment = Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no
Quote this message in a reply
23rd Jan, 2018, 10:32 AM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,334
Joined: Dec 2014
Reputation: 122
RE: Only first device can connect to Samba after restart
After a short test (usually I do not use SAMBA on XBian), I can confirm this issue.

The reason is, smbd process is spawned by inetd process, and this seems not working correctly under Stretch.

For a quick fix, you can

1) disable smbd via inetd: comment out two lines in fild /etc/inetd.conf like this

Code:
###netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
###microsoft-ds stream tcp nowait root /usr/sbin/smbd smbd

2) comment out RUN_MODE line in file /etc/default/samba

Code:
#RUN_MODE="inetd"

3) make sure that /etc/init/smbd.conf looks like this:

Code:
description "SMB/CIFS File Server"
author      "Steve Langasek <steve.langasek@ubuntu.com>"

start on (local-filesystems and net-device-up)
stop on runlevel [!2345]

respawn

pre-start script
        [ -r /etc/default/samba ] && . /etc/default/samba

        install -o root -g root -m 755 -d /var/run/samba
end script

exec smbd -F

and is not empty

4) reboot
Find all posts by this user
Quote this message in a reply
24th Jan, 2018, 09:29 AM
Post: #3
Dzintars Bergs
Unregistered
 
RE: Only first device can connect to Samba after restart
Thanks! Smile
Quote this message in a reply
2nd Aug, 2018, 11:20 PM
Post: #4
tookdrums Offline
Registered
Posts: 3
Joined: Aug 2018
Reputation: 0
RE: Only first device can connect to Samba after restart
That's awesome.
That is a problem I experienced but I rarely use another laptop for the samba shares so I usually just rebooted the pi.
Find all posts by this user
Quote this message in a reply
1st Jan, 2019, 02:06 AM
Post: #5
Nachteule Offline
Administrator
******
Posts: 2,334
Joined: Dec 2014
Reputation: 122
RE: Only first device can connect to Samba after restart
To finish this thread, I have added a dialog into Kodi's XBian-config GUI for doing this:



You have do enable 'Advanced Mode' in Preferences category for doing that
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  [PROBLEM] SAMBA with USB mountet Device under RC3 Cre@tsheR 10 21,820 16th Aug, 2015 03:28 AM
Last Post: hbunjes

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 24th Mar, 2023, 03:33 AM Powered By MyBB, © 2002-2023 MyBB Group.