Hi,
I’m mounting a webdav share during boot using systemd. Mounting works, but the options for dir_mode and file_mode are not set correctly.
Here is my systemd-mount unit:
[Unit]
Description=mailbox.org Drive
After=network-online.target
Wants=network-online.target
[Mount]
What=https://dav.mailbox.org/servlet/webdav.infostore
Where=/mnt/mailbox.org
Options=uid=1000,gid=users,file_mode=0664,dir_mode=2775,grpid
Type=davfs
TimeoutSec=15
[Install]
WantedBy=multi-user.target
However, upon mounting, the permissions look like this:
drwxr-xr-x 2 andi root 0 22. Aug 2019 Trash
drwxr-xr-x 3 andi root 0 2. Dez 2017 Userstore
From the Options string in the systemd-unit, I would expect the permissions to look as follows:
drwxrwxr-x 2 andi users 0 22. Aug 2019 Trash
drwxrwxr-x 3 andi users 0 2. Dez 2017 Userstore
Any ideas what to do about this?
Thanks,
Andi
xabbu
July 2, 2021, 7:13am
2
tigaente:
gid=users
Did you tired the group ID? You used the name instead of the ID.
Yes, I tried both. The result is the same, though.
xabbu
July 2, 2021, 9:46pm
4
I used this systemd mount file. I changed my normal gid it to gid 976, just to test it.
[Unit]
Description=Mount WebDAV Service
After=network-online.target
Wants=network-online.target
[Mount]
What=https://...
Where=/data/webdav
Options=uid=1000,gid=976,file_mode=0664,dir_mode=2775,grpid
Type=davfs
TimeoutSec=15
[Install]
WantedBy=multi-user.target
The result is
drwxrwsr-x 12 xabbu docker 376 02.07.2021 23:25 webdav
You might want to enable debug messages in davfs to see what is going on.
for exmaple
Jul 02 23:32:30 mount.davfs[3303222]: uid: 1000
Jul 02 23:32:30 mount.davfs[3303222]: gid: 976
Jul 02 23:32:30 mount.davfs[3303222]: dir_mode: 042775
Jul 02 23:32:30 mount.davfs[3303222]: file_mode: 0100664
Ok. Good suggestion to use debug mode. I enabled it it /etc/dav/davfs.conf by setting debug to most.
Here’s the relevant output:
Jul 03 11:40:31 mount.davfs[11106]: /usr/bin/mount.davfs https://dav.mailbox.org/servlet/webdav.infostore /mnt/mailbox.org -o rw,noexec,nosuid,nodev,uid=1000,user
Jul 03 11:40:31 mount.davfs[11106]: Configuration:
Jul 03 11:40:31 mount.davfs[11106]: url: https://dav.mailbox.org/servlet/webdav.infostore
Jul 03 11:40:31 mount.davfs[11106]: mount point: /mnt/mailbox.org
Jul 03 11:40:31 mount.davfs[11106]: dav_user: nobody
Jul 03 11:40:31 mount.davfs[11106]: dav_group: users
Jul 03 11:40:31 mount.davfs[11106]: conf: (null)
Jul 03 11:40:31 mount.davfs[11106]: user: 1
Jul 03 11:40:31 mount.davfs[11106]: netdev: 1
Jul 03 11:40:31 mount.davfs[11106]: grpid: 0
Jul 03 11:40:31 mount.davfs[11106]: mopts: 0xc0ed000e
Jul 03 11:40:31 mount.davfs[11106]: buf_size: 0 KiB
Jul 03 11:40:31 mount.davfs[11106]: uid: 1000
Jul 03 11:40:31 mount.davfs[11106]: gid: 0
Jul 03 11:40:31 mount.davfs[11106]: dir_mode: 040755
Jul 03 11:40:31 mount.davfs[11106]: file_mode: 0100644
It seems, the gid is not picked up correctly. It gives me 0 instead of 985 as configured. Also my dir_mode is not parsed correctly.
For reference, here is my current Options line from the systemd-mount-unit:
Options=uid=1000,gid=985,file_mode=0664,dir_mode=2775,grpid
Ok, one more thing. When mounting manually like so:
sudo /usr/bin/mount.davfs "https://dav.mailbox.org/servlet/webdav.infostore" /mnt/mailbox.org -o rw,uid=1000,gid=985,file_mode=066
4,dir_mode=2775,grpid
it gives the following:
ls -la /mnt/
drwxrwsr-x 6 andi users 184 2. Dez 2017 mailbox.org
which is what I would expect. When mounting through systemd it mounts with the wrong options.
I solved it. The problem seems to have been an old entry in /etc/fstab that I used before migrating to systemd mounting. Apparently, systemd read the contents of /etc/fstab first and automatically created a unit for that which took precedence over my own unit-file.
So, I re-did the entire unit configuration and stuff works now as expected.
system
Closed
July 18, 2021, 11:01am
8
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.