nerdexam
CompTIA

XK0-005 · Question #10470

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…

The correct answer is D. REQUIRES=mariadb.service. 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…

System Management

Question

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?

Options

  • ATRIGGERS=mariadb.service
  • BONFAILURE=mariadb.service
  • CWANTEDBY=mariadb.service
  • DREQUIRES=mariadb.service

How the community answered

(31 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    10% (3)
  • D
    81% (25)

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

Topics

#systemd#Service Management#Service Dependencies#Unit Files

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice