nerdexam
CompTIA

XK0-005 · Question #865

A systems administrator needs to create a new service unit file. This new unit file is required to start when all services are running with the command-line interface only. Which of the following…

The correct answer is C. WantedBy=multi-user.target. In a systemd unit file, 'WantedBy=multi-user.target' specifies that the service should be started when the system reaches the multi-user target, which represents a fully operational CLI environment (no graphical interface) with all standard services running - equivalent to the…

System Management

Question

A systems administrator needs to create a new service unit file. This new unit file is required to start when all services are running with the command-line interface only. Which of the following options should the administrator use to accomplish this task?

Options

  • AWantedBy=basic.target
  • BWantedBy=network-online.target
  • CWantedBy=multi-user.target
  • DWantedBy=graphical.target

How the community answered

(31 responses)
  • A
    6% (2)
  • C
    90% (28)
  • D
    3% (1)

Explanation

In a systemd unit file, 'WantedBy=multi-user.target' specifies that the service should be started when the system reaches the multi-user target, which represents a fully operational CLI environment (no graphical interface) with all standard services running - equivalent to the traditional runlevel 3. Option A (basic.target) is an earlier boot stage before most services are up. Option B (network-online.target) is for network-dependent services but does not imply all services are running. Option D (graphical.target) includes a desktop GUI, which is not required here.

Topics

#systemd#service management#boot targets#unit files

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice