<title>Type</title>
<para>The type consists of a single letter and optionally an
- exclamation mark.</para>
+ exclamation mark and/or minus sign.</para>
<para>The following line types are understood:</para>
running system, and will only be executed with
<option>--boot</option>.</para>
+ <para>If the minus sign is used, this line failing to run
+ successfully during create (and only create) will not cause
+ the execution of <command>systemd-tmpfiles</command> to return
+ an error.</para>
+
+ <para>For example:
+ <programlisting># Modify sysfs but don't fail if we are in a container with a read-only /proc
+w- /proc/sys/vm/swappiness - - - - 10</programlisting></para>
+
<para>Note that for all line types that result in creation of any kind of file node
(i.e. <varname>f</varname>/<varname>F</varname>,
<varname>d</varname>/<varname>D</varname>/<varname>v</varname>/<varname>q</varname>/<varname>Q</varname>,
bool force:1;
+ bool allow_failure:1;
+
bool done:1;
} Item;
r = arg_create ? create_item(i) : 0;
q = arg_remove ? remove_item(i) : 0;
p = arg_clean ? clean_item(i) : 0;
+ /* Failure can only be tolerated for create */
+ if (i->allow_failure)
+ r = 0;
return t < 0 ? t :
r < 0 ? r :
ItemArray *existing;
OrderedHashmap *h;
int r, pos;
- bool force = false, boot = false;
+ bool force = false, boot = false, allow_failure = false;
assert(fname);
assert(line >= 1);
boot = true;
else if (action[pos] == '+' && !force)
force = true;
+ else if (action[pos] == '-' && !allow_failure)
+ allow_failure = true;
else {
*invalid_config = true;
log_error("[%s:%u] Unknown modifiers in command '%s'",
i.type = action[0];
i.force = force;
+ i.allow_failure = allow_failure;
r = specifier_printf(path, specifier_table, NULL, &i.path);
if (r == -ENXIO)