3.3 Runlevels Flashcards

2
Q

Which file affects the default runlevels?

A

The /etc/inittab file affects the default runlevels.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why would you set the runlevel to 1?

A

Runlevel 1 is single-user mode, which is typically used for maintenance or troubleshooting tasks as it limits the daemons started and only allows a single user to login.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference in functionality between a runlevel 1 and runlevel 3?

A
  • Runlevel 1 is single user mode, in which the system runs only enough daemons to allow a single user to log in. It is typically used for maintenance.
  • Runlevel 3 is extended multi-user mode, in which the system provides multi-user mode support in addition to all network services, including Network File System. It is typically used for normal operations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which runlevel reboots the system, and which runlevel shuts the system down?

A
  • Runlevel 0 shuts the system down.
  • Runlevel 6 reboots the system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What commands can be used to change the runlevel?

A

The init and telinit commands can be used to change the runlevel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you enter kernel options during the system boot up?

A

Using the ‘a’ key (to insert new kernel options) or the ‘e’ key (to edit existing kernel options) while in the GRUB boot menu.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you identify the current and previous runlevels?

A

The runlevel command identifies the previous and current runlevels, respectively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a runlevel?

A

A runlevel is collection of services that defines a specific system state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the runlevel state 0.

A

This is the halt state. In runlevel 0, the system has no daemons in memory and is ready to be turned off.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the runlevel state 1.

A

This is single user mode. In single user mode, the system uses only enough daemons to allow a single user to log in, and is often used for maintenance tasks. The user is automatically logged in as the root user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe the runlevel state 2.

A

This is multi-user mode. In multi-user mode, the system allows multiple users to log in. It also provides networking services with the exception of the Network File System.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the runlevel state 3.

A

This is extended multi-user mode. In extended multi-user mode, the system provides multi-user mode support in addition to all network services, including Network File System.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe the runlevel state 4.

A

This runlevel is undefined, but can be defined if necessary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Describe the runlevel state 5.

A

This is graphical mode. In graphical mode, the system provides the same capabilities as in extended user mode. However, the system also supports graphical log ins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the runlevel state 6.

A

This is the reboot runlevel. In this runlevel, the system re-starts itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the init daemon do and how does it use /etc/inittab?

A

During the boot process, the init (initialize) daemon loads all the other daemons that control the system. Init uses the /etc/inittab file to determine the default runlevel, and then starts the appropriate daemons for that runlevel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the four fields in /etc/inittab?

A

The colon-separated fields in /etc/inittab are:

  1. label
  2. runlevel(s)
  3. action
  4. command
    i. e., label:runlevel(s):action:command
19
Q

What does the label field of /etc/inittab do?

A

Organizes the file to allow the init daemon to read it alphabetically.

20
Q

What does the runlevel(s) field of /etc/inittab do?

A

Specifies the runlevel(s) to which the line corresponds.

21
Q

What does the action field of /etc/inittab do?

A

Tells init what action to take (e.g., respawn, wait, boot, bootwait, powerfail, powerwait).

22
Q

What does the command field of /etc/inittab do?

A

This field designates a shell command to execute.

23
Q

What does the /etc/inittab line id:3:initdefault: do?

A

Indicates that init should set the system runlevel at 3 by default.

24
Q

What does the /etc/inittab line si::sysinit:/etc/rc.d/rc.sysinit do?

A

Indicates that that init should execute the /etc/rc.d/rc.sysinit command prior to entering a runlevel when the system initializes.

25
Q

What does the /etc/inittab line cmd:123:wait:/sbin/custom do?

A

Runs the special script file /sbin/custom for runlevels 1, 2, and 3.

26
Q

What does the /etc/inittab line l5:5:wait:/etc/init.d/rc 5 do?

A

Determines which script runs when invoking an init command. The wait parameter in the action field means that init should wait until the command is done running before moving on.

27
Q

What does the /etc/inittab line ca::ctrlaltdel:/sbin/shutdown -r -t 4 now do?

A

Specifies what happens when a user presses Ctrl+Alt+Del.

28
Q

What does the runlevel command do?

A

Displays the previous runlevel and the current runlevel, respectively.

  • The previous runlevel is the first number.
  • The current runlevel is the second number.
  • An N as the first number specifies that the current runlevel is the runlevel into which the computer booted.
  • An S specifies that the runlevel is single user mode (i.e., runlevel 1).
29
Q

What does N mean when displayed as the first output value of the runlevel command?

A

An N as the first number specifies that the current runlevel is the runlevel into which the computer booted.

30
Q

What does S mean when displayed as an output value of the runlevel command?

A

An S specifies that the runlevel is single user mode (runlevel 1).

31
Q

What does the init command do?

A

Changes the runlevel of the computer. Same as telinit.

32
Q

What does the telinit command do?

A

Changes the runlevel of the computer. Same as init.

33
Q

What does the command init s (or telinit s) do?

A

Changes the runlevel to 1, which is single-user mode

34
Q

What does the command init q (or init Q, or telinit q, or telinit Q) do?

A

Causes init to re-examine the inittab file.

35
Q

What do kernel options do?

A

Kernel options allow customization of Linux boot parameters to permit administrators to fix several problems related to booting.

36
Q

What does specifying a runlevel value (digit) as a kernel option do?

A

Boots into the specified runlevel.

37
Q

What does the vga kernel option do?

A

Changes monitor display settings. E.g., vga=0x307 sets the monitor resolution to 1280x1024 with 256 colors.

38
Q

What does the init kernel option do?

A

Change the program that the kernel starts at boot time. E.g., init=/bin/bash starts the bash shell at boot time.

39
Q

What does the acpi kernel option do?

A

Enable or disable the advanced configuration and power interface (ACPI). E.g., acpi=off disables ACPI.

40
Q

What does the apm kernel option do?

A

Enable or disable advanced power management (APM). E.g., apm=off disables ACPI.

41
Q

How do you insert new kernel options directly into the existing boot options?

A

In the GRUB boot menu:

  1. Select the operating system.
  2. Press the ‘a’ key.
  3. Add the kernel boot options to the existing boot options.
42
Q

How do you oappend kernel options onto existing options listed in the /boot/grub/grub.conf file?

A

In the GRUB boot menu:

  1. Select the operating system.
  2. Press the e key.
  3. Select the kernel line.
  4. Press the e key.
  5. Add the kernel boot options to the existing boot options.
43
Q

How do you interrupt normal system initialization for maintenance or troubleshooting, then continue the initialization process when finished?

A
  1. Specify init=/bin/bash as a kernel option during system boot,
  2. Perform necessary maintenance or troubleshooting activities,
  3. Execute the comand exec /sbin/init when finished to start system initialization.