33.4k views
0 votes
Which file is read by init to get the default runlevel?

1) /etc/profile
2) /etc/init
3) /etc/boot

User Matt Ruwe
by
9.0k points

1 Answer

2 votes

Final answer:

The correct file read by the init process to get the default runlevel is /etc/inittab. None of the other files listed, /etc/profile, /etc/init, or /etc/boot, serve this purpose in a SysV-style init system.

Step-by-step explanation:

The file /etc/inittab is read by the init process to determine the default runlevel on systems that use the traditional SysV-style init system. This configuration file contains various settings for init, including the default runlevel setting, which would typically be found in a line starting with id:, followed by the runlevel number, and ending with :initdefault:.

The options mentioned in the question, namely /etc/profile, /etc/init, and /etc/boot, are not used for this purpose. The /etc/profile file is generally used to set system-wide environment variables for shell sessions, while /etc/init might be a directory used in systems with Upstart or a similar init system rather than specifying runlevels. The /etc/boot option is incorrect as it is not a standard file or directory used for defining default runlevels in Unix-like operating systems.

User Alexandre Legent
by
8.0k points