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

Michael Biebl mbiebl at gmail.com
Tue Mar 18 15:11:12 PDT 2014


/etc/systemd/system# cat fail.service
[Unit]
Description=Fail service

[Service]
ExecStart=/bin/false

2014-03-18 22:59 GMT+01:00 Usman <desert03 at yahoo.com>:
> 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.
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the systemd-devel mailing list