Auto mount problems with webdav

Hi all a couple of issues with this. I’m trying to set up a sync operation with a Box account for a user, so when they either log in or log out, a sync is performed on a specific folder. I have managed to get access to Box via Dolphin, but the sync operation is a manual one. The user is not that experienced with computers, so I need to manually copy the files across. This is obviously not a very good long term solution. I’ve tried writing a couple of scripts to do this, but I’m not that good at Bash/Python/whatever, to get this working properly.

I have managed to create a mount point under “/mnt/…” to the Box account, but I want this to automatically mount upon the user logging in. I have an fstab entry that works if I “sudo mount /mnt/…”, I have created a link to the “/mnt/…” folder in the user’s directory. The user account is part of the davfs2 group. I can’t run the mount command as the user, but if I run it via sudo, it all works and I can see the files in the linked folder.

One of the options in the fstab entry is “auto”, not “noauto”, doesn’t this mean mount automatically? I also have “_netdev” there as well to wait for the network connection. Here is the complete fstab line

https://dav.box.com/dav /mnt/staff@box davfs _netdev,rw,user,auto,uid=staff,gid=davfs2 0 0

Secondly, the credentials for the username and password in the “~/.davfs2/secrets” file are not being looked at, as I need to enter the details in when I mount through sudo.

Any help here?
openSuse 42.2

I can’t help you with all details, but have a few reamrks.

An entry in /etc/fstab will do several things.

  • It will have additional parameters when a mount is done which specifies the device only, the mountpoint only, or both, but for the rest is not complete; in a other words, what is missing in the command (like fstype, mount options, mountpoint, device will be added from the entry. Of course at least the mount point or the device must be specified in the command, else the entry can not be found.
  • The whole /etc/fstab will be used at a
mount -a

and at boot time to mount everything that is in the table, except when the noauto option is present in an entry Please read the man page of mount to find out what this and other options mean).

  • a so called “desktop mount” (where a spontanious connected mass-storage device will be reported to the user “in the seat” and on request will be mounted for him at a special mountpoint) will not take place when an entry in /etc/fstab can be found that corresponds to it. This is a way the system manager can prevent mounts by the user for his own usage, which may be strictly for use by the system manager (as root) in a special mount point (think about backup storage for system backup/recovery).

Now, my only experience in webdav as end-user is that I have an entry in Dolphin (using KDE). Clicking on it opens it (after asking for my Kwallet password when Kwallet is not open) in Dolphin and I can use it. No mount is done for this.

From the above a few observations.

  • The end-user can of course not mount anything that is in /etc/fstab, except when it is configured that end-users might do this (again, read the man page. specially about the option user).
  • When a user must mount at login, this depends of course on the desktop used. Each desktop has it’s own way of starting things at startup.
  • when you want it to be available at all times (for all users or just for a paricular one), I guess the system can mount at boot (and umount at shutdown) on a mountpoint where either all users can access it or where a particular user can access it (with applicable ownership/permissions). This like every other mount.
  • When the dav file system is always available (mounted), I read from your description that you then want to sync on several points in time. Again running something at user login (in CLI and GUI) can be done. On logout (specially from the GUI) I am not sure how to do that.

HTH.