Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

← Service Configuration practice sets

LFCS Service Configuration • Complete Question Bank

LFCS Service Configuration — All Questions With Answers

Complete LFCS Service Configuration question bank — all 0 questions with answers and detailed explanations.

58
Questions
Free
No signup
Certifications/LFCS/Practice Test/Service Configuration/All Questions
Question 1mediummultiple choice
Read the full Service Configuration explanation →

A system administrator configures a web server using systemd. After creating a custom service unit file, the administrator runs `systemctl daemon-reload` but the service still fails to start with a 'Unit not found' error. What is the most likely cause?

Question 2hardmultiple choice
Read the full Service Configuration explanation →

A server runs a custom application that listens on TCP port 8080. The administrator wants to ensure the application starts automatically on boot and restarts if it crashes. Which systemd unit file directive should be used to achieve the restart behavior?

Question 3easymultiple choice
Read the full Service Configuration explanation →

An administrator needs to configure a service to run as a non-root user for security reasons. Which systemd unit file directive accomplishes this?

Question 4hardmultiple choice
Read the full Service Configuration explanation →

A developer reports that a web application's logs are not being written to /var/log/myapp.log. The service runs as user 'myapp' and the log directory /var/log/myapp/ has permissions 755 owned by root. What is the most likely cause?

Question 5mediummultiple choice
Read the full Service Configuration 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?

Question 6mediummulti select
Read the full Service Configuration explanation →

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

Question 7hardmulti select
Read the full Service Configuration explanation →

Which THREE actions will affect the state of a systemd service that is currently running? (Choose three.)

Question 8mediummultiple choice
Read the full Service Configuration explanation →

An administrator runs 'systemctl status sshd' and sees the output above. The administrator wants sshd to start automatically at boot. Which command should be used?

Exhibit

Refer to the exhibit.

# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2025-03-10 14:23:45 UTC; 1h 30min ago
 Main PID: 1234 (sshd)
   CGroup: /system.slice/sshd.service
           └─1234 /usr/sbin/sshd -D

# netstat -tlnp | grep :22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1234/sshd
Question 9hardmultiple choice
Study the full Python automation breakdown →

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?

Question 10easymultiple choice
Read the full Service Configuration explanation →

A Linux administrator needs to temporarily stop a service named 'httpd' without disabling it from starting automatically on subsequent boots. Which command should be used?

Question 11easymultiple choice
Read the full Service Configuration explanation →

A system administrator needs to ensure the Apache httpd service starts automatically on system boot. Which command should they use?

Question 12mediummulti select
Read the full Service Configuration explanation →

Which TWO commands can be used to check the status of the sshd service on a system using systemd?

Question 13hardmultiple choice
Read the full Service Configuration explanation →

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?

Question 14mediumdrag order
Read the full Service Configuration explanation →

Order the steps to create a new partition on a disk using fdisk.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 15mediummatching
Read the full Service Configuration explanation →

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

Question 16easymultiple choice
Read the full Service Configuration explanation →

Which command enables a service to start automatically at boot in a systemd-based system?

Question 17mediummultiple choice
Read the full Service Configuration explanation →

A custom systemd service unit file has been created but the service fails to start with 'Exec format error'. What is the most likely cause?

Question 18hardmultiple choice
Read the full Service Configuration explanation →

An administrator configures a systemd service with Restart=on-failure and RestartSec=10. What happens if the service exits with a non-zero exit code?

Question 19easymultiple choice
Read the full Service Configuration explanation →

To check the details of a failed systemd service unit, including the last log entries, which command is most appropriate?

Question 20mediummultiple choice
Read the full Service Configuration explanation →

A service is configured to run as a specific user. Which directive in the [Service] section sets the user?

Question 21easymultiple choice
Read the full Service Configuration explanation →

Which systemd unit type is used to group services and other units together for boot execution?

Question 22mediummultiple choice
Read the full Service Configuration explanation →

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

Question 23hardmultiple choice
Read the full Service Configuration explanation →

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

Question 24mediummultiple choice
Read the full Service Configuration explanation →

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?

Question 25easymulti select
Read the full Service Configuration explanation →

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

Question 26mediummulti select
Read the full Service Configuration explanation →

Which TWO directives are typically used in a systemd service unit file to configure dependencies?

Question 27hardmulti select
Read the full Service Configuration explanation →

Which THREE of the following are valid systemd unit types?

Question 28mediummultiple choice
Read the full Service Configuration explanation →

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.
Question 29hardmultiple choice
Read the full Service Configuration explanation →

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
Question 30easymultiple choice
Read the full Service Configuration explanation →

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.
Question 31easymultiple choice
Read the full Service Configuration explanation →

A system administrator wants to configure a custom service to start automatically at boot. Which command accomplishes this?

Question 32easymultiple choice
Read the full Service Configuration explanation →

After editing a service unit file, which command must be run for changes to take effect?

Question 33easymultiple choice
Read the full Service Configuration explanation →

Which command displays the current status of all active services?

Question 34mediummultiple choice
Read the full Service Configuration explanation →

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?

Question 35mediummultiple choice
Read the full Service Configuration explanation →

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?

Question 36mediummultiple choice
Read the full Service Configuration explanation →

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

Question 37hardmultiple choice
Read the full Service Configuration explanation →

A system administrator cannot restart a service because another unit 'stop' the request. The status message says 'Unit test.service is not running, but has pending stop job'. What is the most likely cause?

Question 38hardmultiple choice
Read the full Service Configuration explanation →

An administrator wants to run a script daily at 2 AM. They create a timer unit and a service unit. The service unit uses Type=oneshot. Which of the following timer configurations is correct?

Question 39hardmultiple choice
Read the full Service Configuration explanation →

A service unit has the directive 'ExecStartPre=/bin/true' and 'ExecStart=/usr/bin/myapp'. What is the effect of ExecStartPre?

Question 40mediummulti select
Read the full Service Configuration explanation →

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

Question 41mediummulti select
Read the full Service Configuration explanation →

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

Question 42hardmulti select
Read the full Service Configuration explanation →

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

Question 43mediummultiple choice
Read the full Service Configuration explanation →

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 44hardmultiple choice
Read the full Service Configuration explanation →

Refer to the exhibit. An administrator tries to start myapp.service with 'systemctl start myapp.service' but receives 'Failed to start myapp.service: Unit myapp.service is not loaded properly: Invalid argument'. What is the most likely issue?

Exhibit

● systemctl status myapp.service
● myapp.service - My Application
   Loaded: loaded (/etc/systemd/system/myapp.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
   Docs: man:myapp(1)

● systemctl list-dependencies myapp.service
● myapp.service
● myapp.service does not have any dependencies.
Question 45mediummultiple choice
Read the full Service Configuration explanation →

Refer to the exhibit. The service unit file has Restart=on-failure, but systemctl show displays Restart=no. What is the most likely reason?

Exhibit

$ cat /etc/systemd/system/backup.service
[Unit]
Description=Backup Service
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
User=backup
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

$ systemctl show backup.service -p Restart
Restart=no
Question 46easymultiple choice
Read the full Service Configuration explanation →

An administrator deploys a new custom service using a unit file called myapp.service. The service needs to start automatically at system boot. Which command should the administrator run to achieve this?

Question 47easymultiple choice
Read the full Service Configuration explanation →

A service named webserver.service is failing to start. The administrator wants to see the most recent error messages related to this service. Which command provides this information?

Question 48mediummultiple choice
Read the full Service Configuration explanation →

A custom service requires that the network is fully operational before it starts. Which directive should be added to the [Unit] section of the service's unit file to ensure this dependency?

Question 49hardmultiple choice
Read the full Service Configuration explanation →

An administrator wants to limit the CPU usage of a service to at most 50% of a single CPU core. Which directive should be set in the [Service] section of the unit file?

Question 50easymulti select
Read the full Service Configuration explanation →

Which TWO commands can be used to check whether a systemd service is currently running?

Question 51mediummulti select
Read the full Service Configuration explanation →

Which THREE of the following are valid directives for the [Service] section of a systemd unit file?

Question 52easymultiple choice
Read the full Service Configuration explanation →

A system administrator is managing a web application running as a systemd service on a new Linux server. The application requires a specific environment variable, DATABASE_URL, to be set before starting. The administrator has created a custom service unit file at /etc/systemd/system/webapp.service with the following content:

[Unit]

Description=Web Application Service

[Service]

ExecStart=/usr/local/bin/webapp Restart=on-failure

The administrator prefers to keep configuration separate from the unit file for easier updates. The service fails to start. Upon investigation, the administrator notices that the DATABASE_URL variable is not being passed to the process. What is the most appropriate course of action to ensure the environment variable is correctly set?

Question 53mediummultiple 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?

Question 54hardmultiple choice
Read the full Service Configuration explanation →

A system administrator manages a database server service (database.service) that experiences periodic CPU spikes, causing excessive load on the server. The administrator wants to limit the service's CPU usage to 25% of a single CPU core. The service is running on a system with cgroup v2. Which directive should be added to the [Service] section of the unit file to achieve this?

Question 55hardmultiple choice
Read the full Service Configuration explanation →

A company runs a web application stack consisting of a frontend web server (web.service) and a backend application server (app.service). The app.service uses Restart=on-failure to automatically restart if it crashes. The administrator wants the web.service to automatically restart whenever app.service restarts, so that the frontend remains in sync with the backend. Which directive should be added to the web.service unit file's [Unit] section to achieve this?

Question 56easymulti select
Read the full Service Configuration explanation →

A system administrator needs to ensure that a custom service named 'myapp.service' starts automatically after a reboot and also restarts automatically no matter how the service stops, even if it exits normally. Which two actions should the administrator take? (Choose two.)

Question 57hardmultiple choice
Read the full Service Configuration explanation →

Refer to the exhibit. A Linux administrator sees that 'myapp.service' is in a failed state with exit status 1. To troubleshoot, which command should the administrator use to view the full error output that the service produced before exiting?

Exhibit

myapp.service - My Custom Application
   Loaded: loaded (/etc/systemd/system/myapp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2025-03-10 14:23:45 UTC; 2min ago
  Process: 4567 ExecStart=/usr/bin/myapp (code=exited, status=1/FAILURE)
 Main PID: 4567 (code=exited, status=1/FAILURE)
Question 58mediummultiple choice
Read the full Service Configuration explanation →

A company runs an Apache HTTP server hosting multiple virtual hosts on a single server. The server is managed by systemd. After editing the configuration file for one of the virtual hosts, the administrator notices that the entire Apache service fails to start with a syntax error. Other virtual hosts are currently down because the service failed. The administrator must resolve the issue with minimal downtime and without affecting the configuration of the working virtual hosts. Which course of action is most appropriate?

Practice tests

Scored 10-question sessions with instant feedback and explanations.

LFCS Practice Test 1 — 10 Questions→LFCS Practice Test 2 — 10 Questions→LFCS Practice Test 3 — 10 Questions→LFCS Practice Test 4 — 10 Questions→LFCS Practice Test 5 — 10 Questions→LFCS Practice Exam 1 — 20 Questions→LFCS Practice Exam 2 — 20 Questions→LFCS Practice Exam 3 — 20 Questions→LFCS Practice Exam 4 — 20 Questions→Free LFCS Practice Test 1 — 30 Questions→Free LFCS Practice Test 2 — 30 Questions→Free LFCS Practice Test 3 — 30 Questions→LFCS Practice Questions 1 — 50 Questions→LFCS Practice Questions 2 — 50 Questions→LFCS Exam Simulation 1 — 100 Questions→

Practice by domain

Each domain maps to a weighted exam section. Focus on the domain where you are weakest.

User and Group ManagementOperation of Running SystemsEssential CommandsNetworkingService ConfigurationStorage Management

Practice by scenario

Filter questions by type — troubleshooting, exhibit, drag-and-drop, PBQ, ACLs, OSPF, and more.

Browse scenarios→

Continue studying

All Service Configuration setsAll Service Configuration questionsLFCS Practice Hub