4 ms·
I think they rather received a phonecall/pager on the weekend than having it restart. ;-) This is actually part of the self-healing aspect. One way to see if a
by gbraad 3y ago
I think they rather received a phonecall/pager on the weekend than having it restart. ;-)
This is actually part of the self-healing aspect. One way to see if a service restarts is using the following command:
sudo systemctl show [servicename].service -p NRestarts
I prefer to have this set as
Restart=on-failure
Also note, there are OnFailure to trigger an additional log message, or recovery service, and FailureAction to allow actions to happen, such as the suggested 'reboot' ;-)
For reference: https://www.freedesktop.org/software/systemd/man/systemd.unit.html https://www.freedesktop.org/software/systemd/man/systemd.uni...
- ilyt 3y agosudo systemctl show [servicename].service -p NRestarts any way to do that on all services aside from looping ?
- kelnos 3y agoI think a better way (as mentioned by the parent) is to use FailureAction to do something (like send an event to an alerting system). Granted, you have to modify all the .service files that you care about, which is annoying.
- gbraad 3y agoYou would be selective. For OS services you should be able to rely on them... You also don't want to deal with all of them. For this you could otherwise just use journalctl. You also have OOM issues, and this has its own facility.