LPIC-1 System Architecture Practice Question
An administrator is migrating a legacy service from a SysV init system to a systemd unit. The service is a long-running daemon that forks once. The admin writes a unit file of Type=forking, sets PIDFile correctly, and enables the service. On the next reboot, the service starts but systemd reports that the service entered 'failed' state shortly after start, even though the process is running. The log shows: 'PID file /var/run/myservice.pid not readable (yet?) after start.' What is the most likely cause? Options: A) The service does not write its PID file quickly enough, B) The PIDFile path is wrong, C) The unit file should use Type=simple instead, D) The service needs a TimeoutStartSec increase.
⚠ Common exam trap
Many candidates assume a 'failed' state means the process crashed, when in fact systemd's failure can be due to a timing mismatch between the daemon's startup behavior and the default timeout for PID file creation.
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
✓
The service does not write its PID file quickly enough
The error message 'PID file /var/run/myservice.pid not readable (yet?) after start' indicates that systemd started the service and is waiting for the PID file to appear, but the file was not created within the default timeout (5 seconds for Type=forking). Since the service forks once, systemd expects the parent to exit and the child to write its PID to the file. If the daemon takes longer than TimeoutStartSec to write the PID file, systemd marks the unit as failed even though the process is still running. Option B, "The service does not write its PID file quickly enough," correctly identifies this timing issue. Option A, "The PIDFile path is wrong," is incorrect because the log message explicitly says the PID file is not readable *yet*, implying the path is correct but the file has not been written. Option C, "The service needs a TimeoutStartSec increase," is incorrect because TimeoutStartSec is not about the PID file creation; it's about the time systemd waits for the start operation to complete. Option D, "The unit file should use Type=simple instead," is incorrect because Type=simple would not wait for a PID file at all, but the service is designed to fork (which Type=simple cannot handle properly), and the error indicates systemd is expecting a PID file.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The PIDFile path is wrong
Why it's wrong here
Error says 'not readable', not 'not found', implying path exists but empty or unreadable.
- ✓
The service does not write its PID file quickly enough
Why this is correct
Systemd expects the PID file shortly after the forking process exits; a delay causes failure.
- ✗
The service needs a TimeoutStartSec increase
Why it's wrong here
Increasing timeout might mask the delay but not fix the root cause of late PID file creation.
- ✗
The unit file should use Type=simple instead
Why it's wrong here
Type=simple does not track PID files; would change behavior but may not fit daemon's fork model.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 527-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.