Custom postgres socket location
Postgres is compiled by default to use /tmp
as a socket directory. omnibus-gitlab also uses the postgres default.
If there is an existing Postgresql installation on the system where GitLab is installed and user still wants to use the packaged postgres installation will fail because GitLab will try to connect to the external database.
Few options on how to handle this:
- Supply a different port for packaged postgresql
- Supply a
unix_socket_directory
configuration option to postgresql.conf - Compile postgres to use a different socket directory, Postgres docs say
The default is normally /tmp, but can be changed at build time
Considering:
- Easiest to implement. Downside: if existing postgresql db uses a different port there is a chance this bug can reappear for certain users. Still no real isolation as you would expect with a packaged program.
- Semi-difficult to implement. Requires changes when calling any postgres proces, namely supplying
-h PATH_TO_SOCKET_DIR
for every request. - Unknown difficulty. There seems to be no option to do this without changing the source of postgres. Debian/Ubuntu packaged postgres seem to patch the code according to this discussion
Current direction:
I think we should strive towards further isolation of the packaged services so option 2 is proposed here.
Fixes #466 (closed)