Control Services and Daemons Flashcards

1
Q

What is a daemon?

A

Daemons are processes that either wait or run in the background, to perform various tasks.

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

What does the systemd daemon do?

A

systemd manages the startup process for Linux, including service startup and service management in general.

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

What is a service within the systemd context?

A

A service in systemd often refers to one or more daemons.

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

What does PID stand for?

A

Process Identifier

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

In Red Hat Enterprise Linux, what is the first process that starts? (PID 1)

A

systemd

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

What features does systemd provide in Linux?

A
  1. Parallelization (starting multiple services simultaniously).
  2. On-demand starting of daemons.
  3. Automatic service dependency management.
  4. A way of tracking related processes using control groups.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a unit in systemd?

A

A unit is an abstact concept to define objects that the system knows how to manage.

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

What are unit files?

A

Configuration files which encapsulate information about system services, listening sockets, and other relevant objects for the systemd init system.

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

Name the three types of systemd units and their file extensions.

A
  1. Service units (.service)
  2. Socket units (.socket)
  3. Path units (.path)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are .service units?

A

.service units represent system services, and are used to start often accessed daemons, such as a web server.

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

What are .socket units.

A

.sockets represent inter-process communications (IPC) that systemd should monitor.

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

What is a .path unit?

A

.path units delay the activation of a service until a specific file system change occurs.

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

What CLI command is used to manage systemd units.

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

What CLI command will list all currently loaded service units?

A
systemctl list-units --type=service
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What CLI command wil list all units regardless of activation state?

A
systemctl list-units --all
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What CLI command will list units that are both loaded and active?

A
systemctl
17
Q

What CLI command will list all installed unit files and their state?

A
systemctl list-unit-files
18
Q

What CLI command will show the status of a unit?

A
systemctl status unit.type
19
Q

What CLI comand will manualy start a system service?

A
systemctl start unit.type

If the .type is omited from a unit’s name, systemd will assume it’s a . service

20
Q

What CLI command is used to stop a running service?

A
systemctl stop name.type
21
Q

What CLI command will “restart” a running service?

A
systemctl restart unit.type

Restart will completely stop and restart a service resulting in the service getting a new PID assigned.

22
Q

What CLI command will “reload” a running system service?

A
systemctl reload unit.type

Reload will reload a running service without stopping it first, this results in it keeping it’s PID.

23
Q

What CLI command should you use to reload a service if you are not sure if the service has the option to reload?

A
systemctl reload-or-restart unit.type

If the service has the ability to reload itself it will, otherwise it will restart.

24
Q

What CLI command is used to list a systemd unit’s dependencies?

A
systemctl list-dependencies unit.type

To list the services that depend on a unit add the --reverse option fl

25
Q

What CLI command would you use to disable a service and prevent an administrator from accidentaly restarting it?

A
systemctl mask unit.type

Use systemctl unmask unit.type to allow a unit to be enabled.

26
Q

What CLI command would you use to prevent a service from starting at boot?

A
systemctl disable unit.type

Use systemctl enable unit.type to make a service start at boot.