[Samba] Auto-Reconnect After Sleep

Rowland Penny rpenny at samba.org
Fri Dec 15 09:31:36 UTC 2023


On Thu, 14 Dec 2023 17:00:59 -0500
Rob Campbell via samba <samba at lists.samba.org> wrote:

> Hi,
> 
> Is there a way to have my connection re-established when I log back
> in? When I first log in I run a map drive script that mounts my
> shares using 'gio mount "smb://$DC/$mount"' AND 'ln -s
> "$XDG_RUNTIME_DIR/gvfs/smb-share:server=$DC,share=$mount"
> "$HOME/mnt/$mount" so that it shows up in nautilus as a network drive
> and I have it mapped to my local mnt dir.
> 
> When my system goes to sleep and I log back in, I have to run the
> mount script again. Is there another way? I am using Debian 12 with
> Gnome. I prefer Gnome but I can use another DE if it will
> re-establish the connection.

You could alter the mount script so that it automatically mounts your
shares at login, but only does this if they are not mounted.

Rowland



More information about the samba mailing list