Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Stop waiting for systemd units to tell you they are actually dead
🧩 The Challenge
Everyone has dealt with a service that says it stopped, but the process is still hanging out in the background eating memory. It is incredibly annoying to find a pile of zombies or stale workers left over from a failed cleanup.
💡 The Fix
Use the watch command coupled with a specific systemd check to verify the process tree actually cleared out. It stops you from blindly trusting the green checkmark in status output.
watch -n 1 "systemctl status your-service-name || echo 'Service is dead'; pgrep -f your-service-process-name"
⚙️ Why It Works
Running this keeps a live monitor on the process ID list while the unit state transitions. By piping the status output against a manual pgrep, you expose the discrepancy between what systemd claims and what the kernel is actually running.
🚀 Pro-Tip: Stick this in a separate terminal window whenever you’re debugging a tricky reload cycle.
Linux Tips & Tricks | © ngelinux.com | 9/16/2026
