LFCS Essential Commands Practice Question
Exhibit
$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-10-23 09:15:32 UTC; 2min ago
Docs: man:nginx(8)
Process: 1234 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Main PID: 1234 (code=exited, status=1)Refer to the exhibit. The nginx service failed to start. What is the most likely immediate next step to diagnose the issue?
⚠ Common exam trap
The trap here is that candidates often jump to checking logs (Option A) first, but the LFCS exam emphasizes that configuration validation is the fastest and most direct diagnostic step when a service fails to start, especially for nginx where syntax errors are common.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Run nginx -t to test configuration
`nginx -t` tests the configuration file syntax and validity before attempting to start the service. Since nginx failed to start, a configuration error is a common cause, and this command immediately identifies syntax errors or missing directives without restarting the service.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run journalctl -u nginx.service -x -n 50
Why it's wrong here
Shows logs but not the first step; configuration test is more targeted.
- ✗
Run apt-get install nginx
Why it's wrong here
Reinstalling is unnecessary and may not fix configuration.
- ✗
Run systemctl restart nginx
Why it's wrong here
Restarting without fixing the cause will fail again.
- ✓
Run nginx -t to test configuration
Why this is correct
Tests configuration syntax, often the cause of exit-code 1.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.