static int bus_manager_log_shutdown(
Manager *m,
InhibitWhat w,
-/// elogind does not support systemd units
-#if 0
+#if 0 /// elogind does not support systemd units
const char *unit_name) {
const char *p, *q;
HandleAction action,
sd_bus_error *error) {
-/// elogind does not need these, we do it ourselves
-#if 0
+#if 0 /// elogind does not need these, we do it ourselves
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
char *c = NULL;
const char *p;
bus_manager_log_shutdown(m, w, action);
-/// elogind does it directly without depending on systemd running the system
-#if 0
+#if 0 /// elogind does it directly without depending on systemd running the system
if (m->shutdown_dry_run) {
log_info("Running in dry run, suppressing action.");
reset_scheduled_shutdown(m);
"ss", NULL, "replace-irreversibly");
#else
r = shutdown_or_sleep(m, action);
+
+ /* no more pending actions, whether this failed or not */
+ m->pending_action = HANDLE_IGNORE;
+ m->action_what = 0;
#endif // 0
if (r < 0)
return r;
-/// elogind neither needs a dbus reply, nor supports systemd action jobs
-#if 0
+#if 0 /// elogind neither needs a dbus reply, nor supports systemd action jobs
r = sd_bus_message_read(reply, "o", &p);
if (r < 0)
return r;
log_info("Creating /run/nologin, blocking further logins...");
- r = write_string_file("/run/nologin", "System is going down.", WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC);
+ r = write_string_file_atomic_label("/run/nologin", "System is going down.");
if (r < 0)
log_error_errno(r, "Failed to create /run/nologin: %m");
else
action_multiple_sessions = "org.freedesktop.login1.halt-multiple-sessions";
action_ignore_inhibit = "org.freedesktop.login1.halt-ignore-inhibit";
} else if (streq(type, "poweroff")) {
- action = "org.freedesktop.login1.poweroff";
- action_multiple_sessions = "org.freedesktop.login1.poweroff-multiple-sessions";
- action_ignore_inhibit = "org.freedesktop.login1.poweroff-ignore-inhibit";
+ action = "org.freedesktop.login1.power-off";
+ action_multiple_sessions = "org.freedesktop.login1.power-off-multiple-sessions";
+ action_ignore_inhibit = "org.freedesktop.login1.power-off-ignore-inhibit";
} else
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unsupported shutdown type");
r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_AUGMENT|SD_BUS_CREDS_TTY|SD_BUS_CREDS_UID, &creds);
if (r >= 0) {
- const char *tty;
+ const char *tty = NULL;
(void) sd_bus_creds_get_uid(creds, &m->scheduled_shutdown_uid);
(void) sd_bus_creds_get_tty(creds, &tty);
}
}
-/// elogind does not support utmp-wtmp
-#if 0
+#if 0 /// elogind does not support utmp-wtmp
r = manager_setup_wall_message_timer(m);
if (r < 0)
return r;
cancelled = m->scheduled_shutdown_type != NULL;
reset_scheduled_shutdown(m);
-/// elogind does not support utmp-wtmp
-#if 0
+#if 0 /// elogind does not support utmp-wtmp
if (cancelled) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
const char *tty = NULL;
sd_bus_message *reply,
void *userdata,
sd_bus_error *error) {
-/// elogind does not support EFI
-#if 0
+#if 0 /// elogind does not support EFI
int r;
assert(bus);
if (r == 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
-/// elogind does not support EFI
-#if 0
+#if 0 /// elogind does not support EFI
r = efi_set_reboot_to_firmware(b);
if (r < 0)
return r;
void *userdata,
sd_bus_error *error) {
-/// elogind does not support EFI
-#if 0
+#if 0 /// elogind does not support EFI
int r;
bool challenge;
const char *result;