🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now β†’
Menu

Categories

Linux Service Reliability: Monitoring Auto-Restarts, Crashes, and Watchdogs

Linux Service Reliability: Monitoring Auto-Restarts, Crashes, and Watchdogs

Service Reliability Monitoring

On production servers, service stability is paramount. Frequent restarts indicate underlying issues that need investigation before they cause outages.

Checking Failed Services

systemctl --failed
systemctl list-units --state=failed
systemctl status failed-service.service

Monitoring Restart Counts

systemctl show nginx.service -p NRestarts
systemctl show --all | grep NRestarts | sort -t= -k2 -rn

Restart Policies

# In unit file [Service] section:
# Restart=always|on-failure|on-abnormal|on-abort
# RestartSec=5
# StartLimitBurst=3
# StartLimitIntervalSec=60

systemctl show nginx -p Restart,RestartUSec

Watchdog Configuration

# WatchdogSec=30 in unit file
systemctl show nginx -p WatchdogUSec
systemd-analyze dot --order | grep watchdog

Crash Log Analysis

journalctl -p err --since "24 hours ago"
journalctl -u nginx --since "1 week ago" | grep -i "crash\|segfault\|killed"
coredumpctl list

Automated Monitoring with dargslan-service-restart

pip install dargslan-service-restart
dargslan-service-restart
dargslan-service-restart --failed
dargslan-service-restart --restarts
Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.