mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 02:03:37 +08:00
fstab-generator: add x-systemd.wants
This is an analog of x-systemd.requires that adds a Wants dependency instead. This is useful for filesystems that support mounting in degraded states (such as multi-device filesystems).
This commit is contained in:
parent
99d4575e54
commit
21aa180b4a
@ -216,6 +216,17 @@
|
||||
<xi:include href="version-info.xml" xpointer="v220"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>x-systemd.wants=</option></term>
|
||||
|
||||
<listitem><para>Configures a <varname>Wants=</varname> and
|
||||
an <varname>After=</varname> dependency between the created
|
||||
mount unit and another systemd unit, similar to the
|
||||
<varname>x-systemd.requires=</varname> option.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v257"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>x-systemd.before=</option></term>
|
||||
<term><option>x-systemd.after=</option></term>
|
||||
|
@ -416,6 +416,11 @@ static int write_requires_after(FILE *f, const char *where, const char *opts) {
|
||||
"x-systemd.requires\0", STRV_MAKE_CONST("Requires", "After"));
|
||||
}
|
||||
|
||||
static int write_wants_after(FILE *f, const char *where, const char *opts) {
|
||||
return write_dependency(f, where, opts,
|
||||
"x-systemd.wants\0", STRV_MAKE_CONST("Wants", "After"));
|
||||
}
|
||||
|
||||
static int write_before(FILE *f, const char *where, const char *opts) {
|
||||
return write_dependency(f, where, opts,
|
||||
"x-systemd.before\0", STRV_MAKE_CONST("Before"));
|
||||
@ -469,6 +474,10 @@ static int write_extra_dependencies(FILE *f, const char *where, const char *opts
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = write_wants_after(f, where, opts);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = write_before(f, where, opts);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user