101.3 Change runlevels / boot targets and shutdown or reboot system Flashcards

1
Q

Define run level.

A

A run level is a predefined configuration that the computer will operate within.

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

In how many run levels can a computer operate at a time?

A

One at a time only.

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

What is the purpose of Runlevel 1?

A

Single user mode. Used for maintenance tasks and repair functionality.

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

What is the purpose of runlevel 2?

A

Multiple users can log again, but without any networking interface nor are there any remote file systems mounted.

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

What is the purpose of runlevel 4?

A

Not used, but it is available should an administrator want to set up a custom run level environment

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

What is the purpose of runlevel 5?

A

Not used, but it is available should an administrator want to set up a custom run level environment

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

What is the purpose of runlevel 6?

A

Reboot runlevel (init stops services and restarts the system going back through the complete computer bootup sequence once again).

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

What is the purpose of runlevel 3?

A

Multiple users can log with networking capabilities.

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

How do you read the following in the /etc/inittab file?

id : 3 : initdefault _

A

: : :

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

Where are the scripts that init works with to get a system up and running?

A

In RHEL: /etc/rc.d

In Debian: /etc/init.d

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

Within /etc/rc.d/rc3.d directory (for runlevel 3), what do the numbers mean after the letters K and S?

A

The numbers after the letters indicate the numerical order in which the scripts are to be killed and started.

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

What is an advantage upstart has over init?

A

Upstart can start services in parallel to one another rather than waiting on one service to start before it could start up the next one.

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

What will happen if Upstart detects a service that has stopped working unexpectedly?

A

Upstart monitors the services that it works with. If a service stops working Upstart will attempt to get it running again.

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

Where will the Linux kernel look for an initialization daemon named init?

A

/sbin directory ( /sbin/init )

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

List the order of the init boot sequence.

A

/sbin/init > /etc/inittab > /etc/rc.d/rc.sysinit > /etc/rc.d/rcX.d > login

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

In the upstart boot sequence, as file systems come online, startup will run which script?

A

The /etc/init/rc-sysinit.conf script

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

What does the rc-sysinit.conf script do?

A

It tells init to switch into the default run level via the run level command.

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

What does Linux call a change in the system that would trigger an Upstart job?

A

An event

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

When will Upstart stop a service?

A

Upstart will only kill a service if an event calls for it or if an administrator manually stops it.

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

What is the initial state of an Upstart job?

A

Waiting. It isn’t doing anything yet, but is just waiting to do something.

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

What does the Starting state mean?

A

The starting state means that the job itself is about to start.

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

What does the Stopping state mean?

A

The stopping state is an interim state where the job has processed a section of its configuration known as pre-stop. The job is not actually stopping at this point.

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

What does the Running state of a job mean?

A

A job’s running state means that the job is running.

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

What does the killed state mean in Upstart?

A

The killed state is where the job is actually stopping.

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

What does the post-stop job state mean?

A

The post stop state is where the job has completely stopped.

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

What job state follows after post-stop?

A

It goes back into the waiting state.

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

What is the order of the Upstart jobs?

A

Waiting > Starting > Running > Stopping > Killed > Post-stop > (Waiting …)

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

What is an innovation of Systemd?

A

Systemd removed the need to have shell scripts.

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

What language is used to write Systemd functionalities?

A

Systemd functionalities are written in C code.

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

Is Systemd backwards compatible with System V bash init scripts?

A

Yes, they are, although systemd C code is faster, more robust and more efficient.

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

What does systemd use instead of bash init scripts?

A

Systemd utilizes what are known as unit files.

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

Where are the systemd unit files that take precedence on the system?

A

The systemd unit files that take precedence on the system are the ones located in /etc/systemd/system

33
Q

How can you view all of the unit files on your computer?

A

By running #systemctl list-unit-files

34
Q

How can you view a unit file on the system?

A
Use the command:
#systemctl cat something.unit
35
Q

What do systemd unit files use to go to /sbin/init?

A

A symbolic link.

36
Q

What command can you use to verify what run level you are currently in?

A

runlevel

37
Q

What does the output of the runlevel command display?

A

$ runlevel
N 3
———–
N=previous run level - 3=current runlevel

38
Q

What are 2 ways you can change runlevels in an init system?

A

1) #telinit # (# = runlevel you wish)

2) #init # ( # = runlevel you wish)

39
Q
What does this output mean?
# runlevel
5 3
A

We were previously in runlevel 5 and now are in in runlevel 3

40
Q

In system V init and upstart systems, where does the telinit # command pull the info from?

A

We pull this information out of the /etc/inittab file

41
Q

What is a target unit file in systemd systems?

A

It dictates the type of environment that you would work in.

42
Q

What is a target unit purpose?

A

A target unit’s purpose is to synchronize with the other units on a computer when it boots up or when it is instructed to change states.

43
Q

Run Level 5 provided on a classic init system is the same as the _____ in a systemd system.

A

Graphical.target

44
Q

What target gets started right after Systemd takes over for the kernel and gets the basic system started?

A

sysint.target

45
Q

What target would you use to get into a multi user command line environment?

A

Multi-user.target

46
Q

Run level 3 on a classic init system is analogous to what target in a systemd system?

A

Multi-user.target

47
Q

What target is the same as runlevel 1 in a systemd system?

A

rescue.target

48
Q

What do you call the target that provides an isolated environment for the root user to perform repairs on the system?

A

rescue.target

49
Q

What is the name of the target that provides a basic system that is utilized during the boot process before the system changes into its default target?

A

Basic.target

50
Q

What command would you use to shut off the system using the runlevels?

A

telinit 0

51
Q

What command would you use to look at all of the target unit files on our system?

A

systemctl list-unit-files -t

52
Q

You can change the default target to something else by using this command:

A
#systemctl set-default +targetname:
#systemctl set-default multi-user.target
53
Q

What command do you use to power off a system using targets?

A

systemctl poweroff

54
Q

What command do you use to log into rescue mode in systemd systems?

A

systemctl rescue

55
Q

What system V init command will reboot a computer?

A

telinit 6

56
Q

What is a simple command to reboot a Linux system?

A

reboot

57
Q

What command do you use to reboot a system and specify a time when we want the system to reboot?

A

shutdown -r now

58
Q

What command can you use to send messages to other users and let them know a system will be rebooted?

A
#wall
(type message on next line) and hit crtl+D
59
Q

What is the simplest way to power off a system?

A

poweroff

60
Q

On an older upstart or System V init system, what command can you use to power off a system?

A

telinit 0

61
Q

To power off a computer, what command do you use to specify a time to power it off?

A

shutdown -h 1 minute

62
Q

What does ACPID stand for?

A

Advanced Configuration and Power Interface.

63
Q

What does usually the ACPID daemon monitor?

A

Events that typically involve power management such as :
+powering off the computer
+putting the computer to sleep in a suspend mode +hibernating the computer

64
Q

What runs on top init?

A

Upstart

65
Q

What target invokes a graphical desktop?

A

graphical.target

66
Q

In the upstart boot sequence, what does the startup check in the /etc/init/rc-sysinit.conf script?

A

It checks to see if there is an /etc/inittab file to see if there are any configuration options set there.

67
Q

What does the Advanced Configuration and Power Interface daemon do?

A
It registers system events such as
\+pressing the power button
\+ closing the laptop lid
\+the ctl+alt+del sequence
\+mouse movement or pressing a key if the computer is asleep to wake it up.
68
Q

How do you isolate a target to change to another target?

A

systemctl isolate nameoftarget

69
Q

What does it mean that a symbolic link has a letter S or a letter K within /etc/rc.d/rcX.d directory?

A

Beginning with a K = services to be killed.

Beginning with an S = scripts are to be started.

70
Q

What user do you have to be logged on as to change runlevels in an init system?

A

Root

71
Q

Within the contents of the /etc/rc.d/rc3.d directory (for runlevel 3), you will find:

A

Symbolic links back to the original script files under /etc/init.d.

72
Q

What user can login in run level 1?

A

Typically only the root user is allowed to log into the system.

73
Q

What is the purpose of Runlevel 0?

A

+Halts the computer (init runs scripts that stops services and power off the system).

74
Q

If you’re on a Linux distro using Systemd, what commands can you use to power off the computer?

A
#systemctl isolate poweroff.target
#systemctl isolate shutdown.target
75
Q

In a systemd system, what command can you use to reboot the computer?

A

systemctl isolate reboot.target

76
Q

What command would you use to look at all of the target unit files currently active on your system?

A

systemctl list -units -t target

77
Q

How can you modify what runlevel to land on without changing the /etc/inittab file?

A
  1. Reboot the computer (#reboot)
  2. Interrupt the boot sequence
  3. Enter GRUB menu
  4. Press A to modify the kernel arguments
78
Q

What do you need to do to change the current running target to another one?

A

You need to isolate the target.

79
Q

Does Upstart start and stop services in an asynchronous manner?

A

Yes.