I had encountered this problem during my first few weeks on the job at my workplace. The User or Guest who had already mapped their drive from the server were experiencing random disconnection. So these are some basic troubleshooting I did which proves to be temporary:
1. Ping the Server IP = OK
2. Re-mapped the drive from Server = OK
3. Disable and re-enable network connection (LAN in my case) = OK
As I said above (OK) it works but only temporary, but few hours later the User gets disconnected once more.
I got permission to re-configure the server (make sure you do too! or else do it at your own risk)
After searching the internet, (found few relevant results like 1 or 2 that are helpful) I fired up putty and ssh'ed to the server...
I backed up the original configuration file
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
And added 2 new options to the Global section in the Samba configuration file (which is at /etc/samba/smb.conf)
Keepalive
[global]
...
keepalive = 5
deadtime = 500
...
This options when specified with a value (example 5 as above) will send packets to the User PC every minute specified, if the clients received the packets, then Samba will continue to maintain connection with that computer. Put in mind though that this option will strain your server resource, because packets are sent every 5 minutes (Interval) . Now although the User PC is off or shutdown, samba will still continue to send packets to the the moon every 5 minutes. I recommend 5 to 15.
Deadtime
This option will monitor the connected clients activity, if there's no activity between Samba and the User PC, Samba will disconnect that computer (after the value specified in minutes). I don't recommend to put it that high, but in my situation, users are connecting to samba at an interval of 2 to 3 hours apart, if the value is low they will get disconnected eventually.
So I hope this explains, but do checkout SO_KEEPALIVE which is another alternative
I do not post it here as it doesn't suit my situation.
All the best to all the linux administrator out there :D
0 comments:
Post a Comment