[systemd-devel] Act on exit code differently?

Lennart Poettering lennart at poettering.net
Sat Apr 21 04:47:40 PDT 2012


On Wed, 18.04.12 13:54, Sven Anders (anders at anduras.de) wrote:

> Hello!
> 
> Is it possible to act differently on exit codes?

No. This is currently not possible.

> The service may terminate fatal or temporarily.
> 
> If the termination is temporarily (exit codes 0|12|13|14|15|16|17) I want the
> service to be respawned. On Exit codes 1|6|8|10|11|18|19 it should respawn, but
> with a longer sleep.
> Otherwise on the fatal case (exit codes 5|2|3|4|7|9) it should not try to respawn
> the service.

This is a relatively complex restart logic. It probably is a better idea
to implement that as child process of systemd.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list