Re: Helmut Grohne > Say we were to add a postgresql-running.target and then have the > postgresql-generator also generate a drop-in for that target making it > [email protected] for each instance. Then other services > could Require=postgresql-running.target to be restarted when any > postgresql instance restarts.
This sounds like a very complicated solution for a problem that lies elsewhere. The other service should be able to say "InterestedInRestartsOf=postgresql@*.service" with a pattern match. (No idea if that exists.) That said, there is probably room for improvement here. I remember that when I wrote postgresql.service, I had to choose between synchronous start (postgresql.service waits for postgresql@*.service to start) and synchronous stop (same on shutdown). There was no way to make both wait. On to of that, postgresql.service should rather be postgresql.target, but back then, targets didn't support reloading. I admit that it's been a while since I last tried to understand the differences between Wants After PartOf and the like... > That said, I'm not super convinced that this is a good solution. Maybe > spending more effort on the debci side is warranted. In principle, debci > should work with a remote postgresql server and then no such > notification can happen. You are not alone. Apps freaking out after database restarts is still widely seen. Christoph

