On 1/9/19 11:00 AM, Simon Matter via CentOS wrote: >> On Wed, Jan 09, 2019 at 10:43:38AM -0500, Steve Clark wrote: >>> I am trying to understand what After= means in a unit file. Does it >>> mean after the specified target is up and operational or only that >>> the target has been started? >>> >>> I have something that needs postgres but postgres needs to be >>> operational not just started. Sometimes it can take a bit for >>> postgres to become operational. >> >> I believe that the postgresql service has Type=notify in it's service >> definition, which means that it will notify systemd when it is >> operational. This means that if you have a service that has >> After=postgresql.service, systemd should wait until after the >> postgresql service notifies systemd that it is operational before your >> service will be started. >> >> If your service is starting and unable to connect to postgresql, then >> I would say that's a bug in postgresql -- it shouldn't be notifying >> systemd that it is operational until it actually is. > > This is, in fact, one of the points why I'm very unhappy with systemd and > the way it is implemented here and most likely in most distributions. > > Maybe things _could_ be done the right way with systemd, but it doesn't > happen because it quickly starts to be very complex and it's a lot of work > to do it for a complete distribution. It just doesn't happen - or at least > did not happen in all the years since its introduction. Yes, introduction of systemd earned Linuxes a lot of refugees. I in my worst times feel maybe that was the goal of it. But then I think about a split of refugees from Linux to UNIX descendants (FreeBSD, NettBSD etc.) vs to MS products, and I am not quite certain if that was a goal (though I do remember MS alliance with RedHat...), but if it was the goal I doubt refugee split was in MS favor (though one says something is better than nothing). I hope, this didn't come as a rant, I should probably have used rant tags ;-) Valeri > > In this example, PG gets just started with "pg_ctl start" and that's it. > > Regards, > Simon > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos > -- ++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++