For a systemd-managed service, inspect its status and recent journal before restarting it repeatedly. The earliest application error usually explains more than the final “failed” state. These commands apply to Linux systems using systemd, not every managed hosting container.
Read the failure without changing it
systemctl --failed
systemctl status example.service --no-pager -l
sudo journalctl -u example.service -b -n 100 --no-pagerReplace example.service with the actual unit name. The journal command shows up to 100 records for that service from the current boot. Inspect locally and redact secrets before sharing output; application logs may include request details.
| Clue | Check |
|---|---|
| Executable not found | Configured command and installed runtime path |
| Permission denied | Service user and access to the named file |
| Address already in use | Another process listening on the configured port |
| Missing configuration | Working directory and expected environment |
| No space left | Filesystem capacity and inode availability |
Check the service environment
A command that works in your interactive shell may fail under a different user or working directory. Shell profile settings are not automatically the service’s configuration. Compare the executable path, readable files and required environment with the unit definition.
- Save the current unit and application configuration.
- Identify one specific failure and correct its cause.
- If the unit definition changed, reload systemd’s unit configuration.
- Restart only the affected service during an appropriate window.
- Check fresh logs and make a real request to the application.
Confirm sustained operation
An active process can still be unhealthy. Verify its expected listener, dependency connections and user-facing behavior. Check again after the usual failure interval. Increasing restart frequency or clearing a failure state does not fix the underlying error.
Use disk-full diagnostics for storage errors and VPS monitoring to catch recurrence.
Sources and references
Hosting documentation. Publication and update dates reflect this edition.
Related articles
- Linux Disk Full: Checking Space, Inodes and the Right FilesystemFind the exhausted filesystem before removing data or expanding a VPS disk.2 min read
- Diagnosing NGINX 502 Bad Gateway on a VPSCheck the configured upstream, application listener and matching error log before increasing timeouts.2 min read
- VPS Monitoring: CPU, Memory, Disk and Useful AlertsConnect operating-system metrics to application symptoms and test the alert path before relying on it during an outage.3 min read
