chiark / gitweb /
systemctl: introduce reset-maintenance command
[elogind.git] / src / automount.c
index e685c96a76ab7206b9407484d9a92bc89c652169..213b178eaebd3744c43e0d0784dd84f1129fb8a0 100644 (file)
@@ -791,6 +791,17 @@ static void automount_shutdown(Manager *m) {
                 close_nointr_nofail(m->dev_autofs_fd);
 }
 
+static void automount_reset_maintenance(Unit *u) {
+        Automount *a = AUTOMOUNT(u);
+
+        assert(a);
+
+        if (a->state == AUTOMOUNT_MAINTENANCE)
+                automount_set_state(a, AUTOMOUNT_DEAD);
+
+        a->failure = false;
+}
+
 static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = {
         [AUTOMOUNT_DEAD] = "dead",
         [AUTOMOUNT_WAITING] = "waiting",
@@ -827,6 +838,8 @@ const UnitVTable automount_vtable = {
 
         .fd_event = automount_fd_event,
 
+        .reset_maintenance = automount_reset_maintenance,
+
         .bus_message_handler = bus_automount_message_handler,
 
         .shutdown = automount_shutdown