diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index d061736b733..9c6c2140961 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -216,6 +216,17 @@
+
+
+
+ Configures a Wants= and
+ an After= dependency between the created
+ mount unit and another systemd unit, similar to the
+ x-systemd.requires= option.
+
+
+
+
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index b4df9d23c2a..6b7445b201d 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -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;