#include "event-util.h"
#include "fd-util.h"
#include "fileio.h"
-#include "fileio-label.h"
#include "format-util.h"
#include "fs-util.h"
#include "logind-action.h"
+++ /dev/null
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-
-#include <sys/stat.h>
-
-#include "fileio-label.h"
-#include "fileio.h"
-#include "selinux-util.h"
-
-int create_shutdown_run_nologin_or_warn(void) {
- int r;
-
- /* This is used twice: once in systemd-user-sessions.service, in order to block logins when we
- * actually go down, and once in systemd-logind.service when shutdowns are scheduled, and logins are
- * to be turned off a bit in advance. We use the same wording of the message in both cases.
- *
- * Traditionally, there was only /etc/nologin, and we managed that. Then, in PAM 1.1
- * support for /run/nologin was added as alternative
- * (https://github.com/linux-pam/linux-pam/commit/e9e593f6ddeaf975b7fe8446d184e6bc387d450b).
- * 13 years later we stopped managing /etc/nologin, leaving it for the administrator to manage.
- */
-
- r = write_string_file("/run/nologin",
- "System is going down. Unprivileged users are not permitted to log in anymore. "
- "For technical details, see pam_nologin(8).",
- WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_LABEL);
- if (r < 0)
- return log_error_errno(r, "Failed to create /run/nologin: %m");
-
- return 0;
-}
+++ /dev/null
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#pragma once
-
-#include <stdio.h>
-
-/* These functions are split out of fileio.h (and not for example just flags to the functions they wrap) in order to
- * optimize linking: This way, -lselinux is needed only for the callers of these functions that need selinux, but not
- * for all */
-
-#include "fileio.h"
-
-int create_shutdown_run_nologin_or_warn(void);
'extension-util.c',
'fdset.c',
'fido2-util.c',
- 'fileio-label.c',
'find-esp.c',
'firewall-util-nft.c',
'firewall-util.c',
return s[0] == '1';
}
+
+int create_shutdown_run_nologin_or_warn(void) {
+ int r;
+
+ /* This is used twice: once in systemd-user-sessions.service, in order to block logins when we
+ * actually go down, and once in systemd-logind.service when shutdowns are scheduled, and logins are
+ * to be turned off a bit in advance. We use the same wording of the message in both cases.
+ *
+ * Traditionally, there was only /etc/nologin, and we managed that. Then, in PAM 1.1
+ * support for /run/nologin was added as alternative
+ * (https://github.com/linux-pam/linux-pam/commit/e9e593f6ddeaf975b7fe8446d184e6bc387d450b).
+ * 13 years later we stopped managing /etc/nologin, leaving it for the administrator to manage.
+ */
+
+ r = write_string_file("/run/nologin",
+ "System is going down. Unprivileged users are not permitted to log in anymore. "
+ "For technical details, see pam_nologin(8).",
+ WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_LABEL);
+ if (r < 0)
+ return log_error_errno(r, "Failed to create /run/nologin: %m");
+
+ return 0;
+}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
+
bool reboot_parameter_is_valid(const char *parameter);
int update_reboot_parameter_and_warn(const char *parameter, bool keep);
bool shall_restore_state(void);
bool kexec_loaded(void);
+
+int create_shutdown_run_nologin_or_warn(void);
#include <sys/types.h>
#include <unistd.h>
-#include "fileio.h"
-#include "fileio-label.h"
#include "fs-util.h"
-#include "main-func.h"
#include "log.h"
+#include "main-func.h"
+#include "reboot-util.h"
#include "selinux-util.h"
#include "string-util.h"