Systemd allows to automatically restart services if they have crashed. To prevent indefinite services restart it uses @StartLimitInterval@ and @StartLimitBurst@ variables.
Moreover, I can reboot whole system after service restart failure (it seems reasonable in case: one OS — one service).
The problem is that if I combine those features of systemd and my service fails constantly, I get continuous reboot.
Is there way to stop rebooting PC after the first reboot? In other words, I would like to specify @StartLimitInterval@ and @StartLimitBurst@ variables but for a whole OS, not for a service.
I searched for this feature but found nothing. In the other hand I guess that somebody has solved this problem before.
I think that I can do this by creating lock file before first reboot and then watching it, but it seems ugly and I don't know how to tell systemd create it.