]> err.no Git - systemd/commitdiff
shutdown: create /var/run/nologin instead of /etc/nologin which is supported since...
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2010 18:46:02 +0000 (20:46 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2010 18:46:02 +0000 (20:46 +0200)
README
src/shutdownd.c

diff --git a/README b/README
index 12dc9fedd90168e4af593a12958f62bfbe11eaee..756622660c3f18832e942ba7e01ccbca5a5a133e 100644 (file)
--- a/README
+++ b/README
@@ -34,3 +34,4 @@ REQUIREMENTS:
         gtk+ >= 2.20
         dbus >= 1.2.24
         libcap
+        PAM >= 1.1.2 (optional)
index 72a28018cf565ac824c766b605d88ed6f30161aa..bf69fb53673b859c4777c8c8e822a2128f24ff80 100644 (file)
@@ -318,10 +318,10 @@ int main(int argc, char *argv[]) {
                 if (pollfd[FD_NOLOGIN_TIMER].revents) {
                         int e;
 
-                        log_info("Creating /etc/nologin, blocking further logins...");
+                        log_info("Creating /var/run/nologin, blocking further logins...");
 
-                        if ((e = touch("/etc/nologin")) < 0)
-                                log_error("Failed to create /etc/nologin: %s", strerror(-e));
+                        if ((e = write_one_line_file("/var/run/nologin", "System is going down.")) < 0)
+                                log_error("Failed to create /var/run/nologin: %s", strerror(-e));
                         else
                                 unlink_nologin = true;
 
@@ -346,7 +346,7 @@ finish:
                         close_nointr_nofail(pollfd[i].fd);
 
         if (unlink_nologin)
-                unlink("/etc/nologin");
+                unlink("/var/run/nologin");
 
         if (exec_shutdown) {
                 char sw[3];