return log_error_errno(r, "Failed to request match for PropertiesChanged signal: %m");
}
- log_debug("%s manager for %s on %s, %s",
- arg_dry_run ? "Would call" : "Calling",
+ log_debug("%s dbus call org.freedesktop.systemd1.Manager %s(%s, %s)",
+ arg_dry_run ? "Would execute" : "Executing",
method, name, mode);
if (arg_dry_run)
return 0;
if (!m)
return log_oom();
+ log_debug("%s wall message \"%s\".", arg_dry_run ? "Would set" : "Setting", m);
+ if (arg_dry_run)
+ return 0;
+
r = sd_bus_call_method(
bus,
"org.freedesktop.login1",
polkit_agent_open_maybe();
(void) logind_set_wall_message();
+ log_debug("%s org.freedesktop.login1.Manager %s dbus call.", arg_dry_run ? "Would execute" : "Executing", method);
+ if (arg_dry_run)
+ return 0;
+
r = sd_bus_call_method(
bus,
"org.freedesktop.login1",
return 0;
}
+ if (access(KEXEC, X_OK) < 0)
+ return log_error_errno(errno, KEXEC" is not available: %m");
+
r = find_esp_and_warn(arg_esp_path, false, &where, NULL, NULL, NULL, NULL);
if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */
return log_error_errno(r, "Cannot find the ESP partition mount point.");
if (!options)
return log_oom();
- log_debug("%s kexec kernel %s initrd %s options \"%s\".",
- arg_dry_run ? "Would load" : "loading",
- kernel, initrd, options);
+ log_full(arg_quiet ? LOG_DEBUG : LOG_INFO,
+ "%s "KEXEC" --load \"%s\" --append \"%s\"%s%s%s",
+ arg_dry_run ? "Would run" : "Running",
+ kernel,
+ options,
+ initrd ? " --initrd \"" : NULL, strempty(initrd), initrd ? "\"" : "");
if (arg_dry_run)
return 0;
if (r < 0)
return r;
if (r == 0) {
-
const char* const args[] = {
KEXEC,
"--load", kernel,
_exit(EXIT_FAILURE);
}
- return wait_for_terminate_and_check("kexec", pid, WAIT_LOG);
+ r = wait_for_terminate_and_check("kexec", pid, WAIT_LOG);
+ if (r < 0)
+ return r;
+ if (r > 0)
+ /* Command failed */
+ return -EPROTO;
+ return 0;
}
static int set_exit_code(uint8_t code) {
} else if (a == ACTION_KEXEC) {
r = load_kexec_kernel();
- if (r < 0)
+ if (r < 0 && arg_force >= 1)
+ log_notice("Failed to load kexec kernel, continuing without.");
+ else if (r < 0)
return r;
} else if (a == ACTION_EXIT && argc > 1) {