Commit 1361c796a3ec3276346ce34907e4e84a41d7e004

Authored by Jacob Vosmaer
1 parent 642608b3
Exists in 6-6-stable-ee

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 %>
... ...