Created attachment 204800 [details]
Patch to add Requires.
Add a REQUIRES for postgresql if PostgreSQL is selected. This prevents quasselcore from starting before PostgreSQL is ready.
I guess technically PostgreSQL could be on a different server. But I'd like a way to have this show up somehow in the start script if the user has PostgreSQL on the same server and using PostgreSQL for the quassel database.
Also, the BUGS section of rcorder(8) is "interesting" in this context. I'm not sure what the right answer is here. koobs@ and I have been discussing this on IRC, but didn't come to a conclusion.
Thanks for submitting this.
The other issue I can think of with this, is if a user has enabled the PGSQL option at compile time, but is not using it (is using sqlite). Will this prevent the quasselcore server from starting because postgresql is not started?
I note that the PGSQL option only adds a dependency on postgresql95-client (the server is not installed as a dependency).
What options do we have available to us to configure rcorder to "if postgresql server is installed then start quasselcore after postgresql, or otherwise just start quasselcore regardless"?
(In reply to Ben Woods from comment #3)
The idea with postgresql clients is that there's no way of knowing if the postgresql server is running on the same machine as the client. It is very common that the database cluster is running on a separate system from the client.
With that said, I'm not sure, but doesnt't REQUIRE only kick in if the required service is actually enabled? the REQUIRE just sets the rcorder, it does not really require the service per se. This can easily be checked.
Also, the patch seems to not really do the trick:
%%NO_PGSQL%%# REQUIRE: LOGIN
%%PGSQL%%# REQUIRE: LOGIN postgresql
rather sometthing like
# REQUIRE: LOGIN %%REQUIRE_POSTGRESQL%%
and setting the REQUIRE_POSTGRESQL substitute variable in the Makefile, in that case?
(In reply to Palle Girgensohn from comment #4)
> doesn't REQUIRE only kick in if the required service is actually enabled?
> the REQUIRE just sets the rcorder, it does not really require the service per se.
If that’s correct, then I think you have solved this one for us. Have you got a few minutes to test this?
> # REQUIRE: LOGIN %%REQUIRE_POSTGRESQL%%
That looks much cleaner.
I feel like this is something that should be added to one of the handbooks, to describe how to do this. Probably here: