mirror of
https://github.com/systemd/systemd.git
synced 2026-08-07 00:21:01 +00:00
shutdown: pass own argv to /run/initramfs/shutdown
Since commit b1e90ec515 systemd passes
its log settings to systemd-shutdown via command line parameters.
However, systemd-shutdown doesn't pass these parameters to
/run/initramfs/shutdown, causing it to fall back to the default log
settings.
This fixes the following bugs about the shutdown not being quiet
despite "quiet" being in the kernel parameters:
https://bugs.freedesktop.org/show_bug.cgi?id=79582
https://bugs.freedesktop.org/show_bug.cgi?id=57216
This commit is contained in:
committed by
Lennart Poettering
parent
a07e9cfb79
commit
a2726e5ced
@@ -313,7 +313,7 @@ int main(int argc, char *argv[]) {
|
||||
access("/run/initramfs/shutdown", X_OK) == 0) {
|
||||
r = switch_root_initramfs();
|
||||
if (r >= 0) {
|
||||
arguments[0] = (char*) "/shutdown";
|
||||
argv[0] = (char*) "/shutdown";
|
||||
|
||||
setsid();
|
||||
make_console_stdio();
|
||||
@@ -321,7 +321,7 @@ int main(int argc, char *argv[]) {
|
||||
log_info("Successfully changed into root pivot.\n"
|
||||
"Returning to initrd...");
|
||||
|
||||
execv("/shutdown", arguments);
|
||||
execv("/shutdown", argv);
|
||||
log_error("Failed to execute shutdown binary: %m");
|
||||
} else
|
||||
log_error("Failed to switch root to \"/run/initramfs\": %s", strerror(-r));
|
||||
|
||||
Reference in New Issue
Block a user