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;
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);
}
}
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];