[systemd-devel] Should a unit be able to start, while its OnFailure unit is active?

Jean-Pierre.Bogler at continental-corporation.com Jean-Pierre.Bogler at continental-corporation.com
Wed Jan 14 07:24:15 PST 2015

Hi all,

I'd like to have your opinion on the following problem: 

In case a unit fails, we are using an OnFailure unit to 
handle the error (e. g. reset the config of the failed 
unit) and restart it.

In one case the failed unit had dependencies to other 
units. Therefore, the failed unit was (re-)started when 
the other units started.

This way, the OnFailure unit was active (which could 
delete the config), *while* the failed unit, which reads 
the config, was restarting!

Is this behavior intended or could it be an advantage to 
let a unit "conflict" to its OnFailure unit in some way? 

A first idea for a workaround is to add an "After" 
dependency to the OnFailure unit in the real unit's 
service file. This way a job for the unit should be 
created but the unit would not start until the 
OnFailure unit finbished. Is this correct?

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150114/210ef738/attachment.html>

More information about the systemd-devel mailing list