[systemd-devel] How to manually set service in "failed" state

Usman desert03 at yahoo.com
Tue Mar 18 14:59:50 PDT 2014


Hi Guys,

I am trying to test some code with respect to my services setup. I have two services, lets say service_a and service_b. In service_a unit file I have this:

OnFailure=service_b


And from the man page for OnFailure unit I get this:

A space-separated list of one or more units that are activated when this unit enters the "failed" state

My question is, to test this setup, how can I have service_a in a "failed" state? I have tried using kill -9, but that leaves service in "signal" state and not "failed" state. How can I manually set a service in "failed" state so that service_b gets started for my testing? Any specific signal? Any help much appreciated.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140318/1b1d4ba1/attachment.html>


More information about the systemd-devel mailing list