[systemd-devel] systemd restart patch
lennart at poettering.net
Tue Feb 8 02:34:19 PST 2011
On Mon, 07.02.11 10:01, Cristian Patrascu (Cristian.Patrascu at windriver.com) wrote:
> On 02/03/2011 11:19 PM, Michael Biebl wrote:
> >2011/2/3 Tomasz Torcz<tomek at pipebreaker.pl>:
> >>On Thu, Feb 03, 2011 at 09:35:55PM +0100, Michael Biebl wrote:
> >>>ExecStartOnFailure=/some/cmd (send an email or what not)
> >> Isn't “OnFailure=send-email-to-admin.service” sufficent?
> >Having to use a service file for this use case is imho cumbersome,
> >especially since you can't pass information to that service afaik,
> >e.g. via env variables.
> >So this send-email-to-admin.service doesn't know which service it was,
> >that failed and its last status code. Or am I misinformed here?
> >Also, does OnFailure= work as I described with regard to Restart=on-failure?
> On 02/03/2011 10:35 PM, Michael Biebl wrote:
> >ExecStartOnFailure=/some/cmd (send an email or what not)
> >If Restart=on-failure is not set, this command is executed when the
> >starting the service has failed.
> 2011/2/3 Cristian Patrascu <Cristian.Patrascu at windriver.com>:
> >- RestartRetries=n (where n is the number of restart retries)
> Using "Restart=on-failure" and "OnFailure=some-other.service", the
> specified service will be started for every restart that exits with
> fail, of current service.
I think tis current behaviour probably makes little sense, so my
suggestion would be to simply change it and run the services listed in
OnFailure= only after we tried to restart the service and gave up.
So here's what I'd suggest:
a) Introduce RestartRetries= as you suggested
b) Reshuffle things so that OnFailure= is run only after RestartRetries=
is reached when it is set or each time if RestartRetries= is not set.
c) Do not introduce ExecPostRestarts=
I think this would be a very simple, minimal and natural extension and
should do everything you need, right? I'd be happy to merge such a patch!
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel