Hi, I have some services configured with the above, Restart=on-failure and StartLimitInterval/StartLimitBurst and also StartLimitAction with reboot.
The problem I am trying to look at is, how to get out of a continuous reboot cycle, if one of the services is failing. That is why I was looking for any options where systemd can have its default target changed to recover or something equivalent, if the system is undergoing repeated reboots within a certain interval? I may be able to do this by writing a separate unit/service for this, but was wondering if there was any already inbuilt mechanism to prevent continuous reboot cycle from a mis-behaving service/unit, which is configured for reload on failure? Thanks Jana On Sat, Feb 13, 2016 at 2:48 AM, Lennart Poettering <[email protected]> wrote: > On Fri, 12.02.16 20:58, Pathangi Janardhanan ([email protected]) wrote: > > > Hi All, > > > > The default target is usually set to multi-user or someother equivalent > > target. Is there any way in systemd that I can say something like > > > > " If the system is reloaded n number of times within the last x second", > > than set the default target to recover or emergency mode etc.? > > > > Basically I am looking for recovering from a failing unit/service that > is > > forcing the system to reboot, and that is going in a cycle? > > You may configure whether a unit shall be automatically restarted with > Restart=on-failure. You may put a limit on it with StartLimitInterval= > and StartLimitBurst=. You may configure what shall happen if the limit > is hit with StartLimitAction=, which includes making the system reboot. > > See the systemd.service and systemd.unit man pages. > > Lennart > > -- > Lennart Poettering, Red Hat >
_______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
