The current postgresql-9.1 init script does not read port configuration from the postgresql.conf file, resulting in a wrong error message about port conflict, when there is no such conflict. This is a minor blocker when running slotted versions (you get suggested to alter PGPORT, which would work). The suggested solution is, however, a bit weird, since after a correct configuration one should not need to fiddle with variables (and postgresql docs are clearly pointing anyone to use postgresql.conf for this issue). I attach a patch I made for my system. I'm positive there are much more elegant ways to make it, but it works for my box.
Created attachment 293701 [details] reads postgresql.conf value for port and uses it
On a second thought, the script in the ebuild would fail to detect a real port conflict, just as well. All it takes is to have one admin modifying PGPORT to bypass the script blocker, then a second edit to the postgresql.conf file, that would state an explicit 5332 value for the port. I haven't checked it personally, but I cannot really see how this could be avoided.
(In reply to comment #2) > On a second thought, the script in the ebuild would fail to detect a real port > conflict, just as well. All it takes is to have one admin modifying PGPORT to > bypass the script blocker, then a second edit to the postgresql.conf file, that > would state an explicit 5332 value for the port. I haven't checked it > personally, but I cannot really see how this could be avoided. Postgres would determine the conflict. The initscript does pass back the error. (At least, it should. It's been a while since I've tested the error handling of the initscript. I like this patch, though, and I'll commit the changes.
I would suggest using awk rather than the readconf function tbh, for the sake of maintainability, but I hit this as well so I wouldn't mind getting it fixed myself if it needs to...
(In reply to comment #4) > I would suggest using awk rather than the readconf function tbh, for the sake > of maintainability, but I hit this as well so I wouldn't mind getting it fixed > myself if it needs to... Right, I actually came up with something using grep and sed. awk and I are not friends.
08 Dec 2011; Aaron W. Swenson <titanofold@gentoo.org> +postgresql-server-8.2.23.ebuild, +postgresql-server-8.3.17.ebuild, +postgresql-server-8.4.10.ebuild, +postgresql-server-9.0.6.ebuild, +postgresql-server-9.1.2.ebuild: Version bump. Fixes bugs 391851, 383471, and 378865.