In SysVinit /etc/inittab, set the default runlevel for normal startup to 3.
Choose the correct initdefault record format.
Which line is correct?
The /etc/inittab form is id:runlevels:action:process. id:3:initdefault: sets the default runlevel to 3 and has no process field.
Detailed explanation
3:id:default:initIncorrect. The fields are in the wrong order and the action is not initdefault.
Incorrect. The fields are in the wrong order and the action is not initdefault.
initdefault:3Incorrect. This is not a valid four-field inittab record.
Incorrect. This is not a valid four-field inittab record.
id:initdefault:3:Correct. It sets id, runlevel 3, initdefault, and an empty process field.
Correct. It sets id, runlevel 3, initdefault, and an empty process field.
id:3:initdefault:Incorrect. The runlevel and action fields are reversed.
Incorrect. The runlevel and action fields are reversed.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'id:3:initdefault:' | awk -F: '{print $1,$2,$3,NF}'Expected result
id 3 initdefault 4Key points
- Four colon-separated fields
- The second field is runlevels
- initdefault has no process
Notes
- Environment: SysVinit / /etc/inittab書式
- 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.