chiark / gitweb /
logind: unlink /run/nologin when shutdown is cancelled
[elogind.git] / src / login / logind-dbus.c
index 1f5cf865b1440824cd5680053ca4a9c99efe487f..3555bcc2f5c007f19b5d86b7a31ca250cb3359ff 100644 (file)
@@ -1964,6 +1964,11 @@ static int method_cancel_scheduled_shutdown(sd_bus_message *message, void *userd
         m->scheduled_shutdown_type = NULL;
         m->scheduled_shutdown_timeout = 0;
 
+        if (m->unlink_nologin) {
+                unlink("/run/nologin");
+                m->unlink_nologin = false;
+        }
+
         if (cancelled) {
                 _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
                 const char *tty = NULL;