> DirectoryMode=0777
so, you might misunderstand what this parameter does; with the mount and
automount units, it sets the mode *only* for directories that need to be
created *up to* the actual mountpoint. So if you had:
[Mount]
What=/dev/disk/by-label/some-label
Where=/media/one/two/disk-with-some-label
DirectoryMode=0777
then the dirs /media/one and /media/one/two will be (note: [1]) mode
0777. However, /media/one/two/disk-with-some-label will not be affected
by DirectoryMode, for both automount and mount units.
For mount units, the directory that is the actual mountpoint has its
mode replaced by the actual mode of the root directory of the mount.
For example:
root@lp1836461:/tmp# ls -ld a
drwxr-xr-x 2 root root 4096 Sep 29 20:59 a
root@lp1836461:/tmp# mount /dev/sda1 a
root@lp1836461:/tmp# ls -ld a
drwx------ 3 root root 1024 Sep 29 20:02 a
root@lp1836461:/tmp# umount a
root@lp1836461:/tmp# ls -ld a
drwxr-xr-x 2 root root 4096 Sep 29 20:59 a
in that example /tmp/a has mode 0755, while the root directory in the
filesystem at /dev/sda1 has mode 0700. The DirectoryMode specified to
the mount unit will not change the filesystem's root dir mode.
For automount units, the DirectoryMode similarly only sets the mode for
newly created dirs leading up to the actual mountpoint. Additionally,
while the mountpoint is waiting for automount, its mode is set to 0755,
but that doesn't matter because any actual access to the directory (e.g.
ls) will cause it to automount the filesystem, which will replace the
'fake' 0755 mode with the actual mode of the filesystem's root dir.
[1] - looks like there is a bug upstream that sets intermediate
automount dirs to 0555, which I'll open a bug for, but for the
description of your use, that doesn't appear important.
** Changed in: systemd (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1836461
Title:
DirectoryMode is not considered in systemd automount
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1836461/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs