Discussion:
Cleanest way to halt a VM after a service has stopped
(too old to reply)
Filipe Brandenburger
2018-02-26 23:54:56 UTC
Permalink
Raw Message
Hi,

I found it's possible to halt a VM after a service has stopped by
using something like this:

ExecStopPost=/sbin/halt -p

Is this the cleanest approach? Or would anyone have a better
recommendation (perhaps using systemd-halt.service or similar)?

Thanks!
Filipe
Lennart Poettering
2018-02-27 09:37:29 UTC
Permalink
Raw Message
Post by Filipe Brandenburger
Hi,
I found it's possible to halt a VM after a service has stopped by
ExecStopPost=/sbin/halt -p
Is this the cleanest approach? Or would anyone have a better
recommendation (perhaps using systemd-halt.service or similar)?
There's FailureAction= and SuccessAction=. Set both to "poweroff". See
systemd.unit(5) for details.

Lennart
--
Lennart Poettering, Red Hat
Loading...