chiark / gitweb /
logind: unlink /run/nologin when shutdown is cancelled
authorDaniel Mack <daniel@zonque.org>
Tue, 26 May 2015 16:56:40 +0000 (18:56 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:00:33 +0000 (10:00 +0100)
When a scheduled is cancelled, make sure to remove /run/nologin.
This is a regression from the recent shutdownd removal and logind rework.

src/login/logind-dbus.c

index 1f5cf86..3555bcc 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;