From 5e0aff564c86838e08c4b1bdd8df182d233a36b8 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 19 Dec 2017 20:22:05 +0000 Subject: [PATCH] man: User=, Group= *never* work for mount units (#7602) Old text: > Note that the User= and > Group= options are not particularly useful for mount units specifying a > "Type=" option or using configuration not specified in /etc/fstab; > mount(8) will refuse options that are not listed in /etc/fstab if it is > not run as UID 0. However I recently learnt the following: > The mount program does not read the /etc/fstab file if both device > and dir are specified. Therefore, if both device and dir are specified, the `user` or `users` options in `fstab` will not have any effect. Run as a normal user, you will always see mount: only root can do that Fix the explanation in the man page. Also make sure to markup User= and Group= with . --- man/systemd.mount.xml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml index 9160db6f30d..8607bd797f8 100644 --- a/man/systemd.mount.xml +++ b/man/systemd.mount.xml @@ -76,13 +76,17 @@ which define the way the processes are terminated, and in systemd.resource-control5, which configure resource control settings for the processes of the - service. Note that the User= and Group= options are not - particularly useful for mount units specifying a - Type= option or using configuration not - specified in /etc/fstab; + service. + + Note that the options User= and + Group= are not useful for mount units. + systemd passes two parameters to + mount8; + the values of What= and Where=. + When invoked in this way, mount8 - will refuse options that are not listed in - /etc/fstab if it is not run as UID 0. + does not read any options from /etc/fstab, and + must be run as UID 0. Mount units must be named after the mount point directories they control. Example: the mount point /home/lennart must be configured in a unit file home-lennart.mount. -- 2.39.2