Skip to content
Snippets Groups Projects
Commit ae094503 authored by Gabriel Mazetto's avatar Gabriel Mazetto :spy_tone1:
Browse files

Default gitlab-psql(-geo) commands to use known database

Fix `could not change directory to "/root": Permission denied`
parent 54fcd297
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -54,7 +54,7 @@ else
privilege_drop="-u ${psql_user}"
fi
 
exec /opt/gitlab/embedded/bin/chpst ${privilege_drop} -U ${psql_user} /opt/gitlab/embedded/bin/psql -p ${psql_port} -h ${psql_host} "$@"
cd /tmp; exec /opt/gitlab/embedded/bin/chpst ${privilege_drop} -U ${psql_user} /opt/gitlab/embedded/bin/psql -p ${psql_port} -h ${psql_host} -d ${psql_dbname} "$@"
EOH
end
end
Loading
Loading
Loading
Loading
@@ -54,7 +54,7 @@ else
privilege_drop="-u ${psql_user}"
fi
 
exec /opt/gitlab/embedded/bin/chpst ${privilege_drop} -U ${psql_user} /opt/gitlab/embedded/bin/psql -p ${psql_port} -h ${psql_host} "$@"
cd /tmp; exec /opt/gitlab/embedded/bin/chpst ${privilege_drop} -U ${psql_user} /opt/gitlab/embedded/bin/psql -p ${psql_port} -h ${psql_host} -d ${psql_dbname} "$@"
EOH
end
end
Loading
Loading
Loading
Loading
@@ -101,15 +101,6 @@ least once. The `gitlab-psql` command cannot be used to connect to a
remote Postgres server, nor to connect to a local non-Omnibus Postgres
server.
 
If you start gitlab-psql from a directory that is not world-readable
(like /root) then `psql` will print a warning message:
```
could not change directory to "/root"
```
This is normal behavior and it can be ignored.
#### Starting a Postgres superuser psql session in Geo tracking database
 
Similar to the previous command, if you need superuser access to the bundled
Loading
Loading
psql_user='<%= node['gitlab']['postgresql']['username'] %>'
psql_host='<%= node['gitlab']['geo-postgresql']['unix_socket_directory'] %>'
psql_port='<%= node['gitlab']['geo-postgresql']['port'] %>'
psql_dbname='<%= node['gitlab']['geo-secondary']['db_database'] %>'
psql_user='<%= node['gitlab']['postgresql']['username'] %>'
psql_host='<%= node['gitlab']['postgresql']['unix_socket_directory'] %>'
psql_port='<%= node['gitlab']['postgresql']['port'] %>'
psql_dbname='<%= node['gitlab']['gitlab-rails']['db_database'] %>'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment