prefix = "The system is going down for reboot at ";
else if (c->mode == SD_SHUTDOWN_KEXEC)
prefix = "The system is going down for kexec reboot at ";
+ else if (c->mode == SD_SHUTDOWN_NONE)
+ prefix = "The system shutdown has been cancelled at ";
else
assert_not_reached("Unknown mode!");
assert(c);
- r = safe_mkdir("/run/systemd/shutdown", 0755, 0, 0);
+ r = mkdir_safe_label("/run/systemd/shutdown", 0755, 0, 0);
if (r < 0) {
log_error("Failed to create shutdown subdirectory: %s", strerror(-r));
return r;
}
t = cescape(c->wall_message);
- if (!t) {
- log_error("Out of memory");
- return -ENOMEM;
- }
+ if (!t)
+ return log_oom();
r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path);
if (r < 0) {
if (!scheduled(&b.command)) {
log_info("Shutdown canceled.");
+ if (b.command.warn_wall)
+ warn_wall(0, &b.command);
break;
}