Which of the following commands brings a system running SysV init into a state in which it is safe to perform maintenance tasks? (Choose TWO correct answers.)
Click on the arrows to vote for the correct answer
A. B. C. D. E.CD
The correct answers are C. init 1 and D. telinit 1.
Explanation:
SysV init is a traditional init system used in many Linux distributions. It is responsible for starting and stopping services and running scripts during system startup and shutdown. When you need to perform maintenance tasks on a system running SysV init, you may need to switch to a maintenance mode that minimizes the number of running services and provides a more predictable environment for troubleshooting and repair.
To bring a system running SysV init into a maintenance mode, you can use either the init or the telinit command with a runlevel parameter. Runlevels are predefined states that define which services are started or stopped. The runlevel 1 is typically used for maintenance tasks, as it only starts essential services and provides a minimal environment.
Here are the explanations for each command:
A. shutdown -R 1 now This command reboots the system immediately and sets the default runlevel to 1, which is the maintenance mode. While this command achieves the desired result, it is not safe for running maintenance tasks, as it does not give you a chance to cleanly shut down running services or save data.
B. shutdown -single now This command switches the system to single-user mode, which is similar to runlevel 1 but with some differences in the way services are started and stopped. Single-user mode is typically used for system repair or recovery, rather than maintenance tasks.
C. init 1 This command switches the system to runlevel 1, which is the maintenance mode. It gracefully shuts down running services and stops unnecessary ones, providing a safe and predictable environment for maintenance tasks.
D. telinit 1 This command is similar to init 1, but it sends a signal to the init process to switch to the specified runlevel. This is useful when you need to change the runlevel from a remote terminal or script.
E. runlevel 1 This command only displays the current runlevel, but does not change it.