chiark / gitweb /
units: introduce umount.target for unmounting all file systems
[elogind.git] / src / automount.c
index 39eb3dd01aafd677e64624c8f1b8745b0e422acc..b5003b3a756babf4a5f77979dd67662cbbf3ade2 100644 (file)
@@ -36,6 +36,7 @@
 #include "unit-name.h"
 #include "dbus-automount.h"
 #include "bus-errors.h"
+#include "special.h"
 
 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
         [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
@@ -194,6 +195,10 @@ static int automount_load(Unit *u) {
 
                 if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(a->mount), true)) < 0)
                         return r;
+
+                if (a->meta.default_dependencies)
+                        if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
+                                return r;
         }
 
         return automount_verify(a);