Meaning that I have to create a myfailureunit<name>.service file/unit for every unit I want to register for? Which in my case is going to be almost all of them, in a high availability system
> -----Original Message----- > From: Lennart Poettering [mailto:lenn...@poettering.net] > Sent: Monday, December 01, 2014 5:46 PM > To: Nekrasov, Alexander > Cc: systemd-devel@lists.freedesktop.org > Subject: Re: [systemd-devel] reacting to unit failures (OnFailure) > > On Mon, 01.12.14 17:10, Nekrasov, Alexander (alexander.nekra...@emc.com) > wrote: > > > Hello, > > > > While converting from Upstart to SystemD, came upon this issue. Is > this case not covered or am I missing something? > > > > In Upstart, I can start a job when another job fails, and there's a > $JOB variable that tells me what was the job that failed. > > > > start on (stopped RESULT=failed PROCESS=post-stop) > > > > script > > echo "this just failed: $JOB" > > end script > > > > In SystemD I can register a unit to be started when another unit > > fails. But there seems to be no way of knowing what unit failed. Is > > that correct? > > The idea is that you use "OnFailure=myfailureunit@%n.service". %n is > automatically replaced by the name of the unit you place this > in. Then, in the failure unit you can identify the instance again with > %i or %I. > > Lennart > > -- > Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel