Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounted CIFS Freezes Computer on Connection Drop
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
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Thu May 28, 2015 6:37 am    Post subject: Mounted CIFS Freezes Computer on Connection Drop Reply with quote

Hello,

I've recently setup my autofs config, because I would like to automatically mount CIFS volumes when connected over VPN connection. But since this is a laptop, where the VPN connection is constantly turned on/off, the setup has to work with these considerations in mind.

My setup is presented below. The /etc/autofs/auto.master contains the following:

Code:

/home/user/Shares /etc/autofs/share --ghost --timeout=10 --nonstrict


The /etc/autofs/share contains the following, which should mount the //nas/private share, which is obviously located on a NAS system that is accessible by resolving local DNS nas. Note that the domain cannot be resolved when the VPN is not connected, but this shouldn't cause any problems, because the DNS system should not return anything, which doesn't cause a long-blocking connections.

Code:

private -fstype=cifs,credentials=/root/.credentials,gid=1000,uid=1000,rw,soft,intr,bg,retrans=1,retry=0,nodev,nosuid,async,_netdev ://nas/private


If I start autofs when the VPN is connected everything works flawlessly, but whole laptop freezes if I disconnect from VPN, which can be confirmed by looking into /var/log/messages:

Quote:

May 27 22:39:36 user kernel: [26254.979077] grsec: unmount of //nas/private by /bin/umount[umount:1580] uid/euid:0/0 gid/egid:0/0, parent /usr/sbin/ automount[automount:1579] uid/euid:0/0 gid/egid:0/0
May 27 22:41:40 user kernel: [26379.055017] CIFS VFS: Server shared has not responded in 120 seconds. Reconnecting...


The following was added to /etc/openvpn/up.sh, which gets called when connecting to VPN:

Code:

/etc/init.d/autofs start


I've also added the following into /etc/openvpn/down.sh, which gets called upon disconnecting the VPN connection.

Code:

umount -l -a -t cifs -f                                                                                                                                                     
/etc/init.d/autofs stop


The problem is if I run the "umount -l -a -t cifs -f" manually I get the following error:

Quote:

umount: /home/user/Shares/private: not mounted


Does anybody have any ideas what to do to lower the timeout value, which is not being taken into account, since in /etc/autofs/auto.master 10 seconds are set, but in /var/log/messages it still takes 120 seconds to respond.

Additionally I would like to know why the umount doesn't recognize the share to be mounted and therefore can't unmount it.

In the best case scenario, I wouldn't even want to wait for 10 seconds, but would like that to be handled in the background without freezing the whole computer.

Any other help would be appreciated.

Thank you
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Fri Jul 17, 2015 6:20 am    Post subject: Reply with quote

Posting to update the thread, maybe somebody missed it and will have some ideas. Any ideas are appreciated, so shoot away even if you have the slightest idea of how to possibly solve the issue.
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