[systemd-devel] StartLimitBurst prevents manual start-up of a service

Nekrasov, Alexander alexander.nekrasov at emc.com
Fri Mar 20 07:04:55 PDT 2015


> -----Original Message-----
> From: Andrei Borzenkov [mailto:arvidjaar at gmail.com]
> Sent: Thursday, March 19, 2015 11:53 PM
> To: Nekrasov, Alexander
> Cc: systemd-devel at lists.freedesktop.org
> Subject: Re: [systemd-devel] StartLimitBurst prevents manual start-up of
> a service
> 
> В Thu, 19 Mar 2015 15:23:41 -0400
> "Nekrasov, Alexander" <alexander.nekrasov at emc.com> пишет:
> 
> > Hi All,
> >
> > Suppose I have a B.service that's doing important work, and an
> A.service that's watching over B memory consumption. So I want to start
> A when I start B, and stop A when I stop B. Also B, being important,
> should be allowed to restart on failures. A, being just a monitor,
> should be left down if it starts failing too often.
> >
> > Suppose I have in A.service:
> >
> > Restart=yes
> > StartLimitInterval=300
> > StartLimitBurst=1
> > StopWhenUnneeded=true
> >
> > Suppose B.service.wants/A.service and in B.service I have:
> >
> > Restart=yes
> > StartLimitInterval=30
> > StartLimitBurst=3
> >
> > What happens is, any start of A is counted against the StartLimitBurst
> limit. Which means, there is no way to let B restart any more frequently
> than A and have A follow B. The same thing applies to starting A
> manually - a systemctl start call will fail if done more frequently than
> once per 300 seconds.
> >
> > The manual systemctl start problem can be fixed by running systemctl
> reset-failed before it, but I couldn't find a way to fix the failing to
> start on a dependency.
> >
> > How do I support this use case?
> >
> 
> Why A is restarted in the first place? Once it is started, it should
> not be cleaned up until B is present, and B will be present as long as
> it is being restarted. Restart of B should not cause restart of A, at
> least not because A suddenly becomes unneeded.

[AN] there are several use cases. One that is the simplest to describe is that B is controlled by a cluster management SW, such as Pacemaker. So B must expose restarts to Pacemaker. So B has Restarts=no, it stops when it fails, then Pacemaker decides if it wants to restart B or not. A has to follow. There's are other scenarios, but the idea is that A cannot run during B's restarts. It can be implemented differently, but A has to restart when B restarts, because A is not capable of reestablishing the relationship without a restart. 

> > Thanks,
> > Alex
> >
> > systemd-210-34.9.x86_64
> > systemd-bash-completion-210-34.9.noarch
> > systemd-rpm-macros-2-7.2.noarch
> > util-linux-systemd-2.25-2.2.x86_64
> > systemd-32bit-210-34.9.x86_64
> > systemd-sysvinit-210-34.9.x86_64
> > systemd-presets-branding-SLE-12.0-12.1.noarch
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list