[systemd-devel] OnFailure= and killing services

Albert Strasheim fullung at gmail.com
Mon Jan 7 06:09:43 PST 2013


Hello all

A question about a slightly older version of systemd.

We are running systemd-37-25.fc16.x86_64.

We have a service called alarmist with a .service file like so:

[Unit]
Description=Raise alarms for %i
DefaultDependencies=no

[Service]
Type=oneshot
TimeoutSec=0
ExecStart=-/path/to/alarmist -service=%i

The idea is that alarmist is run whenever another service fails.

Other services look like this:

[Unit]
OnFailure=alarmist at foo.service

[Service]
RestartSec=10
Restart=always

If we kill -9 a foo process, it seems that the OnFailure= that runs
alarmist only triggers just before systemd restarts foo, not
immediately when foo dies.

Is this the expected behaviour? If not, is this something that might
have been fixed by a newer systemd?

Thanks!

Regards

Albert


More information about the systemd-devel mailing list