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;
close_nointr_nofail(pollfd[i].fd);
if (unlink_nologin)
- unlink("/etc/nologin");
+ unlink("/var/run/nologin");
if (exec_shutdown) {
char sw[3];