Service Management Flashcards

1
Q

Where are the start up scripts/unit files found?

A

/lib/systemd/system
/etc/system/system is a soft link

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

What is the command used for service management?

A

systemctl

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

Could you elaborate on the different states that services can be in?

A

Enabled
Disabled
Active
Inactive
Masked
Static

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

How can all services on a Linux system be listed?

A

systemctl list-unit-files –type=service –all

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

What's the method for listing all enabled services in a Linux system?

A

systemctl list-unit-files –
type=service –state=enabled

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

How can the count of services in the Linux system be determined?

A

systemctl list-unit-files –type-service –all | tail -2

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

How do you obtain the status of a service?

A

systemctl status <service>

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

How can we determine whether a service is currently active or not?

A

systemctl status <service>
or systemctl is-active <service>

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

What steps are involved in starting a service?

A

systemctl start <service>

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

How do you initiate the process of restarting a service?

A

systemctl restart <service>

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

What's the procedure for reloading a service?

A

systemctl reload <service>

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

How is a service stopped gracefully?

A

systemctl stop <service>

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

How can a service be configured to start persistently during system boot?

A

systemctl enable
<service>

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

How can you verify whether a service is enabled or disabled?

A

systemctl status <service> or
systemctl is-enabled <service>

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

Could you explain the distinctions between restarting and reloading a service?

A

restart is a combination of stop and start, it gets a new pid, whereas reload is just reading the configuration of the service so the pid stays the same.

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

What differentiates disabling a service from stopping it?

A

stop stops a service right away,
disable is that when the system boots the service will not come up.

17
Q

What measures can be taken to prevent a service from starting during system boot?

A

systemctl
disable <service>

18
Q

How can you enable and start a service simultaneously?

A

systemctl enable <service> –now

19
Q

How can you disable and stop a service simultaneously?

A

systemctl disable <service> –now

20
Q

What is path to configuration file of httpd?

A

/etc/httpd/conf/httpd.conf

21
Q

What is port number of httpd?

A

80

22
Q

How to add port number in firewall in RHEL 7?

A

firewall-cmd –add-port=#/tcp –permanent

23
Q

How to add a httpd in firewall and apply this change without restarting the entire firewall
service?

A

firewall-cmd — add-service=http —permanent
firewall-cmd —reload
systemctl reload http