Skip to content

Custom postgres socket location

Marin Jankovski requested to merge custom_postgres_socket into master

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:

  1. Supply a different port for packaged postgresql
  2. Supply a unix_socket_directory configuration option to postgresql.conf
  3. Compile postgres to use a different socket directory, Postgres docs say The default is normally /tmp, but can be changed at build time

Considering:

  1. 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.
  2. Semi-difficult to implement. Requires changes when calling any postgres proces, namely supplying -h PATH_TO_SOCKET_DIR for every request.
  3. 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)

Merge request reports