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

Lennart Poettering lennart at poettering.net
Fri Apr 10 09:35:18 PDT 2015


On Thu, 19.03.15 15:23, Nekrasov, Alexander (alexander.nekrasov at emc.com) wrote:

> 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?

I am not sure I follow. Do you want that A is restarted when B is
restarted/stopped? Or do you explicitly not want this?

If you want it to be restarted use BindsTo= from A to B. Then A's
state will follow B.

But I don#t really grok what you are trying to do...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list