The current implementation of systemd.service is unable to stop postgresql (at least in my case). The reason is that the postgresql.service service has status active (exited) and hence pyinfra thinks the service is stopped already.
Some possible solutions:
postgresql operations to start/stop the service.Happy to help if you think this may be useful.
@giuppep this sounds like a bug in the server.SystemdSstatus fact, I think anything active (exited) should be considered running. Will take this opportunity to look at all the statues systemd might use as well.
Fixed this in https://github.com/Fizzadar/pyinfra/commit/a54ac6f07849054ccf35700771d6e15186a80e33; now released in v1.4.1!
Looks like it's working fine now. Thanks a lot for fixing 馃槂
(By the way, great job on the library, I really like it! 馃槈 )