Package: postgresql Version: 15+248 Severity: wishlist Hi Christoph et al,
Some services cope badly when their postgresql connection goes down. Arguably, software should work in that scenario, but practically that's not the case. For instance, debci-collector just hangs and passenger stops processing requests. When these run on the same machine as postgresql, we may mitigate the damage by restarting them. Unfortunately, that's difficult to do with the current systemd units. We have a postgresql.service meta unit and several postgresql@*.service instances. What is being restarted by package upgrades and by needrestart is the instances. The meta unit remains started. Declaring dependencies on the right instance is difficult as it changes with every distribution upgrade. The meta unit solves this using a systemd-generator. Ideally, I could add an [email protected] override indicating that all instances should propagate restarts to another unit. Unfortunately, that's not implemented[1] in systemd. The target unit could [email protected], but we may not set up RequiredBy as that's only valid in the [Install] section. If postgresql.service were to declare Requires for each instance instead of Wants, then postgresql.service were restarted whenever any instance is restarted. Then other services could Requires=postgresql.service to propagate those restarts. Does that sound viable? I'm not sure what other implications this has. Thanks for considering. Helmut [1] https://github.com/systemd/systemd/issues/32382

