nerdexam
CompTIA

XK0-005 · Question #794

A web server will not start on a Linux server. A Linux administrator troubleshooting the issue runs a few commands, which produce the following output: Output 1: systemctl units Output 2: service…

The correct answer is C. systemctl unmask httpd.service. If a web server service is masked, it prevents the service from being started or enabled, requiring the administrator to unmask it before it can operate normally. The systemctl unmask command removes the symlink preventing the service from starting.

System Management

Question

A web server will not start on a Linux server. A Linux administrator troubleshooting the issue runs a few commands, which produce the following output:

Output 1: systemctl units Output 2: service status Output 3: firewall configuration Which of the following commands will allow the administrator to start the web server?

Options

  • Asystemctl stop firewalld.service
  • Bsystemctl daemon-reload
  • Csystemctl unmask httpd.service
  • Dsystemctl enable [email protected]

How the community answered

(28 responses)
  • A
    14% (4)
  • B
    7% (2)
  • C
    75% (21)
  • D
    4% (1)

Why each option

If a web server service is masked, it prevents the service from being started or enabled, requiring the administrator to unmask it before it can operate normally. The `systemctl unmask` command removes the symlink preventing the service from starting.

Asystemctl stop firewalld.service

Stopping the firewall might resolve connectivity issues but does not address the underlying problem of the web server service failing to start if it's masked or otherwise misconfigured.

Bsystemctl daemon-reload

`systemctl daemon-reload` reloads the systemd manager configuration, but it does not unmask a service or start it; it's typically used after modifying unit files.

Csystemctl unmask httpd.serviceCorrect

A masked service in systemd is one that has a symlink pointing to `/dev/null` in `/etc/systemd/system`, effectively preventing it from being started or enabled. If the web server (e.g., `httpd.service`) is masked, using `systemctl unmask httpd.service` will remove this symlink, allowing the administrator to then start the service.

Dsystemctl enable [email protected]

`systemctl enable [email protected]` is used to enable a templated service to start on boot, but it will fail if the service is masked and needs to be instantiated.

Concept tested: systemd service management, masked units, troubleshooting services

Source: https://www.freedesktop.org/software/systemd/man/systemctl.html

Topics

#systemd#Service Management#Troubleshooting#Web Server

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice