summaryrefslogtreecommitdiff
path: root/src/shutdownd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-07 20:46:02 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-07 20:46:02 +0200
commitef9ffbd8065b9e06ef27fb989b1c783daf4dc1df (patch)
tree773d97cc67121670acfab8177e4711b11b801c07 /src/shutdownd.c
parent3c14d26c4746768f1dc63d4b7ac0278a7abe5da1 (diff)
shutdown: create /var/run/nologin instead of /etc/nologin which is supported since PAM 1.1.2
Diffstat (limited to 'src/shutdownd.c')
-rw-r--r--src/shutdownd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shutdownd.c b/src/shutdownd.c
index 72a28018cf..bf69fb5367 100644
--- a/src/shutdownd.c
+++ b/src/shutdownd.c
@@ -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];