Commit 942a4c02109d6c8970443ab86337e03c39ef4f93

Authored by Jacob Vosmaer
1 parent 8b1409eb
Exists in 6-6-stable

Set HOME for the GitLab user in wrapper script

Whenever we `bundle exec` a command as the GitLab user, set the HOME
environment variable accordingly. This is the moral equivalent of the
`-H` in `sudo -u git -H bundle exec ...`.
config/templates/gitlab-rails/bundle_exec_wrapper.erb
... ... @@ -9,5 +9,7 @@ fi
9 9  
10 10 gitlab_user=$(ls -lLd <%= install_dir %>/embedded/service/gitlab-rails/log | awk '{ print $3 }')
11 11  
  12 +export HOME=$(eval echo ~${gitlab_user})
  13 +
12 14 cd <%= install_dir %>/embedded/service/gitlab-rails
13 15 exec <%= install_dir %>/embedded/bin/chpst -u $gitlab_user -U $gitlab_user <%= install_dir %>/embedded/bin/bundle exec <%= command %>
... ...