]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: User=, Group= *never* work for mount units (#7602)
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 19 Dec 2017 20:22:05 +0000 (20:22 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Dec 2017 20:22:05 +0000 (21:22 +0100)
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 <varname>.

man/systemd.mount.xml

index 9160db6f30d80df5b177fe0537572a89767ab3f8..8607bd797f87f7f99444b7431754655e81d19f57 100644 (file)
     which define the way the processes are terminated, and in
     <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
     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
-    <literal>Type=</literal> option or using configuration not
-    specified in <filename>/etc/fstab</filename>;
+    service.</para>
+
+    <para>Note that the options <varname>User=</varname> and
+    <varname>Group=</varname> are not useful for mount units.
+    systemd passes two parameters to
+    <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>;
+    the values of <varname>What=</varname> and <varname>Where=</varname>.
+    When invoked in this way,
     <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-    will refuse options that are not listed in
-    <filename>/etc/fstab</filename> if it is not run as UID 0.</para>
+    does not read any options from <filename>/etc/fstab</filename>, and
+    must be run as UID 0.</para>
 
     <para>Mount units must be named after the mount point directories they control. Example: the mount point <filename
     noindex='true'>/home/lennart</filename> must be configured in a unit file <filename>home-lennart.mount</filename>.