ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 47 - XK0-005 discussion

Report
Export

A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files:

The administrator needs to ensure that the database is available before the web application is started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

A.
TRIGGERS=mariadb.service
Answers
A.
TRIGGERS=mariadb.service
B.
ONFAILURE=mariadb.service
Answers
B.
ONFAILURE=mariadb.service
C.
WANTEDBY=mariadb.service
Answers
C.
WANTEDBY=mariadb.service
D.
REQUIRES=mariadb.service
Answers
D.
REQUIRES=mariadb.service
Suggested answer: D

Explanation:

The administrator should add REQUIRES=mariadb.service to the HTTP server .service file to ensure that the database is available before the web application is started. This directive specifies that the HTTP server unit requires the MariaDB server unit to be started before it can run. If the MariaDB server unit fails to start or stops for any reason, the HTTP server unit will also fail or stop. This way, the dependency between the web application and the database is enforced by systemd.

The other options are not correct directives for accomplishing this task. TRIGGERS=mariadb.service is not a valid directive in systemd unit files. ONFAILURE=mariadb.service means that the HTTP server unit will start only if the MariaDB server unit fails, which is not what we want.

WANTEDBY=mariadb.service means that the HTTP server unit will be started when the MariaDB server unit is enabled, but it does not imply a strong dependency or ordering relationship between them. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Services with systemd; systemd.unit(5) - Linux manual page

asked 02/10/2024
Naveen Nama
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first