Quick Linux Tip #38:
Try: sudo systemctl edit --force --full myapp.service
Info: Restart=on-failure restarts the app after a non-zero exit or crash, while RestartSec adds a delay before restarting. StartLimitBurst and StartLimitIntervalSec help prevent a service from repeatedly restarting in a crash loop.
Examples:
- $ sudo systemctl status myapp # View service status
- $ sudo journalctl -u myapp -f # Follow application logs in real-time
- $ sudo systemctl reset-failed myapp # Reset crash rate limits
Note: Restart modes include no, always, on-failure, and on-abnormal. always also restarts a service after a clean exit (0), while on-failure is generally suitable for services that should restart after crashes or unsuccessful exits.
Leave a Reply