Track down why a service keeps crashing without grepping through a mess

Logging & Journald

Track down why a service keeps crashing without grepping through a mess

🧩 The Challenge

Dealing with a service that flaps or reboots every hour is pure misery when you’re staring at a million lines of unrelated noise in the logs. You just want to see what happened right before it died without wading through the entire journal.

💡 The Fix

Use the journalctl slice and cursor options to jump straight to the exit status of your unit, which saves you from playing detective with timestamps. It’s the fastest way to see exactly what killed the process.

journalctl -u <unit_name> --since "1 hour ago" --priority=err

⚙️ Why It Works

Setting the priority flag to error filters out the chatter and leaves you with the specific failures and stack traces that actually matter. Combining this with the unit filter lets you isolate the behavior of a single service in seconds.

🚀 Pro-Tip: Add -f to the end if you’re currently watching the crash happen in real time.

Linux Tips & Tricks | © ngelinux.com | 11/16/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted