X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshutdownd.c;h=143fa8d825feca845e2e998476f9ae1c2910e76b;hb=26742b3fd8776c6c64e3c1035adc2599ddeb76d1;hp=72a28018cf565ac824c766b605d88ed6f30161aa;hpb=22f4096ca96acd504ac74e7dfad96f07edb6da51;p=elogind.git diff --git a/src/shutdownd.c b/src/shutdownd.c index 72a28018c..143fa8d82 100644 --- a/src/shutdownd.c +++ b/src/shutdownd.c @@ -108,7 +108,7 @@ static void warn_wall(usec_t n, struct shutdownd_command *c) { return; if (c->wall_message[0]) - utmp_wall(c->wall_message); + utmp_wall(c->wall_message, NULL); else { char date[FORMAT_TIMESTAMP_MAX]; const char* prefix; @@ -126,7 +126,7 @@ static void warn_wall(usec_t n, struct shutdownd_command *c) { if (asprintf(&l, "%s%s!", prefix, format_timestamp(date, sizeof(date), c->elapse)) < 0) log_error("Failed to allocate wall message"); else { - utmp_wall(l); + utmp_wall(l, NULL); free(l); } } @@ -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];