For troubleshooting, start a specified executable as the initial process instead of the normal PID 1 program.
Edit the kernel arguments for the boot.
Which argument should be used?
init= tells the kernel which program to run instead of the normal init. This bypasses normal service management and shutdown handling.
Detailed explanation
pid1=/bin/shIncorrect. pid1= is not the standard Linux kernel argument for this purpose.
Incorrect. pid1= is not the standard Linux kernel argument for this purpose.
shell=/bin/shIncorrect. shell= is not the kernel parameter used to select PID 1.
Incorrect. shell= is not the kernel parameter used to select PID 1.
init=/bin/shCorrect. init=/bin/sh requests the specified program as the initial process.
Correct. init=/bin/sh requests the specified program as the initial process.
exec=/bin/shIncorrect. exec= is not the standard parameter for selecting init.
Incorrect. exec= is not the standard parameter for selecting init.
Try it yourself
An example you can run in a temporary verification environment.
grep -o 'init=[^ ]*' /proc/cmdline || echo 'default init path is in use'Expected result
init=を指定していればその値。通常起動ではdefault init path is in useKey points
- init= selects an alternate PID 1
- It can be edited temporarily at boot
- Normal management may be unavailable
Notes
- Environment: Linux / カーネルコマンドライン
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.