]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.exec.xml
core: allow preserving contents of RuntimeDirectory= over process restart
[thirdparty/systemd.git] / man / systemd.exec.xml
index d28de2d0f24026f63927284f3e53d320b24ffe1a..db491b49a078acd3ed1fef6d3162ba1284dae288 100644 (file)
         or more directories by the specified names will be created
         below <filename>/run</filename> (for system services) or below
         <varname>$XDG_RUNTIME_DIR</varname> (for user services) when
-        the unit is started, and removed when the unit is stopped. The
+        the unit is started, and removed when the unit is stopped.
+        It is possible to preserve the directories if
+        <varname>RuntimeDirectoryPreserve=</varname> is configured to
+        <option>restart</option> or <option>yes</option>. The
         directories will have the access mode specified in
         <varname>RuntimeDirectoryMode=</varname>, and will be owned by
         the user and group specified in <varname>User=</varname> and
         </para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>RuntimeDirectoryPreserve=</varname></term>
+
+        <listitem><para>Takes a boolean argument or <option>restart</option>.
+        If set to <option>no</option> (the default), the directories specified in <varname>RuntimeDirectory=</varname>
+        are always removed when the service stops. If set to <option>restart</option> the directories are preserved
+        when the service is both automatically and manually restarted. Here, the automatic restart means the operation
+        specified in <varname>Restart=</varname>, and manual restart means the one triggered by
+        <command>systemctl restart foo.service</command>. If set to <option>yes</option>, then the directories are not
+        removed when the service is stopped. Note that since the runtime directory <filename>/run</filename> is a mount
+        point of <literal>tmpfs</literal>, then for system services the directories specified in
+        <varname>RuntimeDirectory=</varname> are removed when the system is rebooted.
+        </para></listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>MemoryDenyWriteExecute=</varname></term>