π ~1 min read
Table of contents
Symptom & Impact
service mydaemon status shows dead while process exists, confusing monitoring and auto-restart logic.
Environment & Reproduction
RHEL 7 host running SysV compatibility script under systemd wrapper reproduces inconsistent PID status.
Root Cause Analysis
Stale pid files and nonstandard exit codes in init script cause service command to misreport daemon state.
Quick Triage
Compare ps output with pid file, run systemctl status mapped unit, and inspect journalctl for script errors.
Step-by-Step Diagnosis
Trace /etc/init.d script paths, validate lock file handling, and review SELinux AVC logs impacting runtime directories.

Solution – Primary Fix
Fix init script return codes, clean stale pid/lock files, and migrate to native systemctl unit where possible.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Wrap daemon with supervisord, use service command compatibility, or enforce Type=forking with proper PIDFile in systemd.
Verification & Acceptance Criteria
service status and systemctl status must agree, and restart actions should succeed without orphaned processes.
Rollback Plan
Restore previous init script from version control and revert unit mapping symlinks if outage risk appears.
Prevention & Hardening
Adopt standardized daemon templates, audit init scripts quarterly, and alert on pid mismatch from monitoring.
Related Errors & Cross-Refs
Related patterns include start-stop-daemon mismatch, unit masking, and firewalld port bind race conditions.
Related tutorial: View the step-by-step tutorial for rhel-7.
View all rhel-7 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
See Red Hat migration guides from service scripts to systemctl, plus SELinux and journalctl diagnostics references.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.