Hi,
i am searching for a well integrated way to automatically recover an Openvpn tunnel after PC returns from standby. An SMB mount is going through this Openvpn tunnel and at the moment I always need to issue the following command manually:
sudo systemctl restart openvpn-client@openvpn.hidrive.strato.com-myloginname
So i am looking for some Openvpn settings or systemd configurations.
The SMB mount is automated and configured via systemd:
# ls -l /etc/systemd/system/multi-user.target.wants/ | grep hidrive
lrwxrwxrwx. 1 root root 52 21. Jul 18:43 mnt-hidrive.myloginname.automount -> /etc/systemd/system/mnt-hidrive.myloginname.automount
lrwxrwxrwx. 1 root root 47 21. Jul 16:13 openvpn-client@openvpn.hidrive.strato.com-myloginname.service -> /usr/lib/systemd/system/openvpn-client@.service
# ls -l /etc/systemd/system | grep hidrive
-rw-r--r--. 1 root root 132 5. Aug 10:03 mnt-hidrive.myloginname.automount
-rw-r--r--. 1 root root 322 5. Aug 10:03 mnt-hidrive.myloginname.mount
# cat /etc/systemd/system/mnt-hidrive.myloginname.mount
[Unit]
Description=HiDrive Share
[Mount]
What=//myloginname.smb3.hidrive.strato.com/root
Where=/mnt/hidrive.myloginname
Type=cifs
Options=vers=3.02,rw,file_mode=0700,dir_mode=0700,uid=1000,credentials=/home/johndoe/.smb3.hidrive.strato.com-myloginname.credentials
DirectoryMode=0700
[Install]
WantedBy=multi-user.target
# cat /etc/systemd/system/mnt-hidrive.myloginname.automount
[Unit]
Description=HiDrive Share
[Automount]
Where=/mnt/hidrive.myloginname
TimeoutIdleSec=60
[Install]
WantedBy=multi-user.target