|
86 | 86 | <para>A few execution parameters result in additional, automatic |
87 | 87 | dependencies to be added.</para> |
88 | 88 |
|
89 | | - <para>Units with <varname>WorkingDirectory=</varname> or |
90 | | - <varname>RootDirectory=</varname> set automatically gain |
91 | | - dependencies of type <varname>Requires=</varname> and |
92 | | - <varname>After=</varname> on all mount units required to access |
93 | | - the specified paths. This is equivalent to having them listed |
94 | | - explicitly in <varname>RequiresMountsFor=</varname>.</para> |
| 89 | + <para>Units with <varname>WorkingDirectory=</varname>, <varname>RootDirectory=</varname> or |
| 90 | + <varname>RootImage=</varname> set automatically gain dependencies of type <varname>Requires=</varname> and |
| 91 | + <varname>After=</varname> on all mount units required to access the specified paths. This is equivalent to having |
| 92 | + them listed explicitly in <varname>RequiresMountsFor=</varname>.</para> |
95 | 93 |
|
96 | 94 | <para>Similar, units with <varname>PrivateTmp=</varname> enabled automatically get mount unit dependencies for all |
97 | 95 | mounts required to access <filename>/tmp</filename> and <filename>/var/tmp</filename>. They will also gain an |
|
117 | 115 | <varname>User=</varname> is used. If not set, defaults to the root directory when systemd is running as a |
118 | 116 | system instance and the respective user's home directory if run as user. If the setting is prefixed with the |
119 | 117 | <literal>-</literal> character, a missing working directory is not considered fatal. If |
120 | | - <varname>RootDirectory=</varname> is not set, then <varname>WorkingDirectory=</varname> is relative to the root |
121 | | - of the system running the service manager. Note that setting this parameter might result in additional |
122 | | - dependencies to be added to the unit (see above).</para></listitem> |
| 118 | + <varname>RootDirectory=</varname>/<varname>RootImage=</varname> is not set, then |
| 119 | + <varname>WorkingDirectory=</varname> is relative to the root of the system running the service manager. Note |
| 120 | + that setting this parameter might result in additional dependencies to be added to the unit (see |
| 121 | + above).</para></listitem> |
123 | 122 | </varlistentry> |
124 | 123 |
|
125 | 124 | <varlistentry> |
|
132 | 131 | the <function>chroot()</function> jail. Note that setting this parameter might result in additional |
133 | 132 | dependencies to be added to the unit (see above).</para> |
134 | 133 |
|
135 | | - <para>The <varname>PrivateUsers=</varname> setting is particularly useful in conjunction with |
136 | | - <varname>RootDirectory=</varname>. For details, see below.</para></listitem> |
| 134 | + <para>The <varname>MountAPIVFS=</varname> and <varname>PrivateUsers=</varname> settings are particularly useful |
| 135 | + in conjunction with <varname>RootDirectory=</varname>. For details, see below.</para></listitem> |
| 136 | + </varlistentry> |
| 137 | + |
| 138 | + <varlistentry> |
| 139 | + <term><varname>RootImage=</varname></term> |
| 140 | + <listitem><para>Takes a path to a block device node or regular file as argument. This call is similar to |
| 141 | + <varname>RootDirectory=</varname> however mounts a file system hierarchy from a block device node or loopack |
| 142 | + file instead of a directory. The device node or file system image file needs to contain a file system without a |
| 143 | + partition table, or a file system within an MBR/MS-DOS or GPT partition table with only a single |
| 144 | + Linux-compatible partition, or a set of file systems within a GPT partition table that follows the <ulink |
| 145 | + url="http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/">Discoverable Partitions |
| 146 | + Specification</ulink>.</para></listitem> |
| 147 | + </varlistentry> |
| 148 | + |
| 149 | + <varlistentry> |
| 150 | + <term><varname>MountAPIVFS=</varname></term> |
| 151 | + |
| 152 | + <listitem><para>Takes a boolean argument. If on, a private mount namespace for the unit's processes is created |
| 153 | + and the API file systems <filename>/proc</filename>, <filename>/sys</filename>, and <filename>/dev</filename> |
| 154 | + are mounted inside of it, unless they are already mounted. Note that this option has no effect unless used in |
| 155 | + conjunction with <varname>RootDirectory=</varname>/<varname>RootImage=</varname> as these three mounts are |
| 156 | + generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace |
| 157 | + will be a 1:1 copy of the host's, and include these three mounts. Note that the <filename>/dev</filename> file |
| 158 | + system of the host is bind mounted if this option is used without <varname>PrivateDevices=</varname>. To run |
| 159 | + the service with a private, minimal version of <filename>/dev/</filename>, combine this option with |
| 160 | + <varname>PrivateDevices=</varname>.</para></listitem> |
137 | 161 | </varlistentry> |
138 | 162 |
|
139 | 163 | <varlistentry> |
|
938 | 962 | access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths |
939 | 963 | relative to the host's root directory (i.e. the system running the service manager). Note that if paths |
940 | 964 | contain symlinks, they are resolved relative to the root directory set with |
941 | | - <varname>RootDirectory=</varname>.</para> |
| 965 | + <varname>RootDirectory=</varname>/<varname>RootImage=</varname>.</para> |
942 | 966 |
|
943 | 967 | <para>Paths listed in <varname>ReadWritePaths=</varname> are accessible from within the namespace with the same |
944 | 968 | access modes as from outside of it. Paths listed in <varname>ReadOnlyPaths=</varname> are accessible for |
|
957 | 981 | <para>Paths in <varname>ReadWritePaths=</varname>, <varname>ReadOnlyPaths=</varname> and |
958 | 982 | <varname>InaccessiblePaths=</varname> may be prefixed with <literal>-</literal>, in which case they will be |
959 | 983 | ignored when they do not exist. If prefixed with <literal>+</literal> the paths are taken relative to the root |
960 | | - directory of the unit, as configured with <varname>RootDirectory=</varname>, instead of relative to the root |
961 | | - directory of the host (see above). When combining <literal>-</literal> and <literal>+</literal> on the same |
962 | | - path make sure to specify <literal>-</literal> first, and <literal>+</literal> second.</para> |
| 984 | + directory of the unit, as configured with <varname>RootDirectory=</varname>/<varname>RootImage=</varname>, |
| 985 | + instead of relative to the root directory of the host (see above). When combining <literal>-</literal> and |
| 986 | + <literal>+</literal> on the same path make sure to specify <literal>-</literal> first, and <literal>+</literal> |
| 987 | + second.</para> |
963 | 988 |
|
964 | 989 | <para>Note that using this setting will disconnect propagation of mounts from the service to the host |
965 | 990 | (propagation in the opposite direction continues to work). This means that this setting may not be used for |
|
990 | 1015 | that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is |
991 | 1016 | used.</para> |
992 | 1017 |
|
993 | | - <para>This option is particularly useful when <varname>RootDirectory=</varname> is used. In this case the |
994 | | - source path refers to a path on the host file system, while the destination path refers to a path below the |
995 | | - root directory of the unit.</para></listitem> |
| 1018 | + <para>This option is particularly useful when <varname>RootDirectory=</varname>/<varname>RootImage=</varname> |
| 1019 | + is used. In this case the source path refers to a path on the host file system, while the destination path |
| 1020 | + refers to a path below the root directory of the unit.</para></listitem> |
996 | 1021 | </varlistentry> |
997 | 1022 |
|
998 | 1023 | <varlistentry> |
|
1080 | 1105 | such as <varname>CapabilityBoundingSet=</varname> will affect only the latter, and there's no way to acquire |
1081 | 1106 | additional capabilities in the host's user namespace. Defaults to off.</para> |
1082 | 1107 |
|
1083 | | - <para>This setting is particularly useful in conjunction with <varname>RootDirectory=</varname>, as the need to |
1084 | | - synchronize the user and group databases in the root directory and on the host is reduced, as the only users |
1085 | | - and groups who need to be matched are <literal>root</literal>, <literal>nobody</literal> and the unit's own |
1086 | | - user and group.</para></listitem> |
| 1108 | + <para>This setting is particularly useful in conjunction with |
| 1109 | + <varname>RootDirectory=</varname>/<varname>RootImage=</varname>, as the need to synchronize the user and group |
| 1110 | + databases in the root directory and on the host is reduced, as the only users and groups who need to be matched |
| 1111 | + are <literal>root</literal>, <literal>nobody</literal> and the unit's own user and group.</para></listitem> |
1087 | 1112 | </varlistentry> |
1088 | 1113 |
|
1089 | 1114 | <varlistentry> |
|
0 commit comments