You are not logged in.

#1 2018-11-08 20:45:29

simgunz
Member
Registered: 2012-09-04
Posts: 16

systemd automount and drive available only if VPN is enabled

Hi,
I created a mount point for a remote cifs drive as following:

/etc/systemd/system/media-odrive.mount

[Unit]
Description=My Drive
Requires=systemd-networkd.service
After=network-online.target
Wants=network-online.target

[Mount]
What=//cifs/path/
Where=/media/odrive
Options=credentials=/my/smbcredentials,users,uid=1000,noauto,iocharset=utf8,rw,vers=1.0
Type=cifs
TimeoutSec=10

[Install]
WantedBy=multi-user.target

/etc/systemd/system/media-odrive.automount

[Unit]
Description=Automount o-drive 

[Automount]
Where=/media/odrive
TimeoutIdleSec=120

[Install]
WantedBy=multi-user.target

The cifs drive is available only if I am connected to a VPN.

The problems I have are:

1. How can I unmount this driver manually as user once mounted? ('users' mount option seems not helping)

2. If I try to access /media/odrive and there is no internet then the systemd unit media-mdrive.automount fails with the error message:
`Failed with result 'mount-start-limit-hit'`
at this point the unit is dead and I need to restart it manually

3. If internet is available but the VPN is not connected and I try to access /media/odrive the file manager (dolphin) hangs until it goes in timeout and nothing happens
Is it there a way to avoid the timeout? Putting somehow some requirements on the status of the VPN?

4. If the network is interrupted while the drive is mounted it is just crazyness and I am still trying to figure out what exaclty is happening.

Last edited by simgunz (2018-11-08 20:46:18)

Offline

#2 2020-03-31 22:32:01

tapia
Member
Registered: 2013-03-13
Posts: 59

Re: systemd automount and drive available only if VPN is enabled

Hi, could you resolve this issue? I am facing the same problem now.

Offline

#3 2020-03-31 22:42:06

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: systemd automount and drive available only if VPN is enabled

tapia, this thread is very old, and the OP has not been back to the forum since December 2018. Please do not necrobump.

Closing.

Offline

Board footer

Powered by FluxBB