Courseiva

LFCS · topic practice

Service Configuration practice questions

Service Configuration is 12% of the LFCS and covers managing systemd units, networking, and core network services on Linux. The exam tests this through live performance-based tasks: you start, enable, mask, or troubleshoot units with systemctl, configure hostname and DNS resolution, and set up services such as SSH, HTTP, NFS, or chrony, then confirm they persist across reboot.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Service Configuration

What the exam tests

What to know about Service Configuration

Start, enable, mask, and troubleshoot units with systemctl, configure hostname and DNS via hostnamectl and /etc/resolv.conf, and set up services like sshd, httpd, and chronyd. The critical skill is diagnosing failed units with systemctl status and journalctl.

Starting, stopping, enabling, and masking systemd units with systemctl and journalctl

Configuring persistent network settings, hostname, and name resolution on Linux

Setting up and securing SSH server access, keys, and sshd_config options

Deploying services like Apache httpd, NFS exports, or chrony time sync

Watch out for

Common Service Configuration exam traps

  • ▸Running systemctl start without enable, so the service does not survive a reboot during grading
  • ▸Editing sshd_config or exports without reloading or restarting the daemon, leaving changes inactive
  • ▸Using runtime-only ip or hostname commands instead of persistent config files, so settings vanish after reboot

Practice set

Service Configuration questions

20 questions · select your answer, then reveal the explanation

An administrator wants to ensure that a custom service (myapp.service) starts only after the network is available and the PostgreSQL database service is running. Which systemd unit file directive should be used?

Which TWO statements are true about systemd service unit files? (Choose two.)

A system administrator is configuring a custom systemd service that runs a Python script. The script logs output to stdout. The administrator wants to ensure that the service restarts automatically if it crashes, but only after a 10-second delay. Which directive should be added to the [Service] section of the unit file?

A company runs a critical web application on a Linux server. The application is managed by a systemd service called 'myapp.service'. Recently, after a scheduled maintenance reboot, the service failed to start automatically. The administrator manually started it with 'systemctl start myapp' and it ran fine. The unit file is located at /etc/systemd/system/myapp.service and contains: [Unit] Description=MyApp After=network.target [Service] ExecStart=/usr/local/bin/myapp Restart=on-failure [Install] WantedBy=multi-user.target. The administrator wants to ensure the service starts automatically after future reboots. However, after running 'systemctl enable myapp', the service still didn't start after the next reboot. What is the most likely cause?

Match each Linux process signal to its numeric value.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

1

2

9

15

19

A system administrator wants to limit the CPU usage of a service. Which systemd resource control directive should be used?

To ensure a service starts only after /var/lib/mysql is mounted, which directive should be used in the unit file?

A service that was once enabled is now failing to start. The administrator wants to immediately disable it to prevent boot delays. Which command sequence is correct?

Which TWO commands can be used to check the status of a service?

Based on the exhibit, what is the correct interpretation?

Exhibit

Refer to the exhibit.

Output of `systemctl status apache2`:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; generated; vendor preset: enabled)
   Active: active (running) since Mon 2023-08-14 10:15:30 UTC; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1234 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
   Main PID: 5678 (apache2)

Warning: apache2.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Which of the following statements is true about this unit?

Exhibit

Refer to the exhibit.

[Unit]
Description=My Custom Service
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/myservice.sh
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

What can be concluded from the log?

Exhibit

Refer to the exhibit.

Output of `journalctl -u sshd.service --no-pager -p err`:

Jul 15 09:23:45 server sshd[1234]: Failed to start OpenSSH server daemon
Jul 15 09:23:45 server sshd[1234]: sshd.service: main process exited, code=exited, status=255/n/a
Jul 15 09:23:45 server sshd[1234]: Unit sshd.service entered failed state.

A service requires read-write access to a specific directory that is mounted from an NFS share. The directory is mounted via fstab with the option 'noauto'. The service starts before the mount is available. Which configuration change should be made in the service unit file to ensure the service only starts after the mount is mounted?

A system administrator is debugging why a service named 'myapp.service' fails to start. He runs 'systemctl status myapp.service' and sees the status 'failed' with details 'Exit code: 1' and 'Failed with result exit-code'. Which command should be used next to view the full log of the service?

A service unit file includes the following: [Install] WantedBy=multi-user.target. What does this directive accomplish?

Which two commands produce output that includes the current runlevel or target? (Choose two.)

Which two statements are true about systemd socket activation? (Choose two.)

Which three of the following are valid reasons to use 'systemctl mask' instead of 'systemctl disable'? (Choose three.)

Refer to the exhibit. What is the most likely cause of the sshd service failure?

Exhibit

● systemctl status sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2025-03-10 10:15:23 UTC; 2min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 12345 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
 Main PID: 12345 (code=exited, status=255)
   Status: "SSH Daemon exited abnormally"
Question 20mediummultiple choice
Read the full DNS explanation →

A company runs a monitoring agent service (monitor.service) that must start after the network is fully up and the DNS resolver is ready. The service currently has the following dependencies in its unit file:

[Unit]

Description=Monitoring Agent After=network.target Wants=network.target

[Service]

ExecStart=/usr/bin/monitor

The service starts, but often fails to resolve hostnames because DNS is not yet available. Which change should be made to the unit file to ensure the service only starts after DNS is ready?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Service Configuration sessions

Start a Service Configuration only practice session

Every question in these sessions is drawn from the Service Configuration domain — nothing else.

Related practice questions

Related LFCS topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the LFCS exam test about Service Configuration?
Start, enable, mask, and troubleshoot units with systemctl, configure hostname and DNS via hostnamectl and /etc/resolv.conf, and set up services like sshd, httpd, and chronyd. The critical skill is diagnosing failed units with systemctl status and journalctl.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Service Configuration questions in a focused session?
Yes — the session launcher on this page draws every question from the Service Configuration domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other LFCS topics?
Use the topic links above to move to related areas, or go back to the LFCS question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the LFCS exam covers. They are not copied from any real exam or dump site.