mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
shutdown: create /var/run/nologin instead of /etc/nologin which is supported since PAM 1.1.2
This commit is contained in:
parent
3c14d26c47
commit
ef9ffbd806
1
README
1
README
@ -34,3 +34,4 @@ REQUIREMENTS:
|
||||
gtk+ >= 2.20
|
||||
dbus >= 1.2.24
|
||||
libcap
|
||||
PAM >= 1.1.2 (optional)
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user