Boot Time State Management Flashcards

(16 cards)

1
Q

What is the purpose of boot-time state management?

A

Controls when services start during Linux boot; systemd provides commands to enable, disable, mask, and unmask services.

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

What does systemctl enable do?

A

Configures a service to start automatically at boot; creates a symbolic link between the service unit file and a target (e.g., multi-user.target).

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

What is the syntax for enabling a service?

A

sudo systemctl enable <service-name></service-name>

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

Give an example of enabling Apache service.

A

sudo systemctl enable apache2.service

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

What output is shown when enabling a service?

A

Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service; links Apache to multi-user.target so it starts automatically at boot.

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

What does systemctl disable do?

A

Prevents a service from starting automatically at boot; removes the symbolic link created by enable; does not stop a running service or block manual starts.

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

What is the syntax for disabling a service?

A

sudo systemctl disable <service-name></service-name>

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

Give an example of disabling Apache service.

A

sudo systemctl disable apache2.service

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

What output is shown when disabling a service?

A

Removed /etc/systemd/system/multi-user.target.wants/apache2.service; Apache will not start at boot but can be started manually with sudo systemctl start apache2.service.

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

What does systemctl mask do?

A

Blocks a service from being started manually or automatically; replaces the service unit file with a symlink to /dev/null.

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

What is the syntax for masking a service?

A

sudo systemctl mask <service-name></service-name>

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

Give an example of masking Apache service.

A

sudo systemctl mask apache2.service

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

What output is shown when masking a service?

A

Created symlink /etc/systemd/system/apache2.service → /dev/null; any attempt to start Apache will fail.

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

What does systemctl unmask do?

A

Removes the mask from a service; deletes the symlink to /dev/null; allows the service to be enabled or started again.

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

What is the syntax for unmasking a service?

A

sudo systemctl unmask <service-name></service-name>

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

Give an example of unmasking Apache service.

A

sudo systemctl unmask apache2.service; no output unless an error occurs.