When I do
systemctl stop service on a stopped or failed service, it returns 0 and no output. I need to know whether it was running before I call this.
systemctl status before stopping is not an option: it increases running time and introduces race conditions. Both reasons are important in my case.