Commit 052b979e5e8d0c41b4719595862a4bc0b2f072ac

Authored by Jacob Vosmaer
1 parent c7652818

Remove /usr/bin/env from Runit run scripts

files/gitlab-cookbooks/gitlab/attributes/default.rb
@@ -44,6 +44,7 @@ default['gitlab']['user']['git_user_email'] = "gitlab@#{node['fqdn']}" @@ -44,6 +44,7 @@ default['gitlab']['user']['git_user_email'] = "gitlab@#{node['fqdn']}"
44 default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails" 44 default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails"
45 default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails" 45 default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails"
46 default['gitlab']['gitlab-rails']['environment'] = 'production' 46 default['gitlab']['gitlab-rails']['environment'] = 'production'
  47 +default['gitlab']['gitlab-rails']['env'] = {}
47 48
48 default['gitlab']['gitlab-rails']['internal_api_url'] = nil 49 default['gitlab']['gitlab-rails']['internal_api_url'] = nil
49 default['gitlab']['gitlab-rails']['uploads_directory'] = "/var/opt/gitlab/gitlab-rails/uploads" 50 default['gitlab']['gitlab-rails']['uploads_directory'] = "/var/opt/gitlab/gitlab-rails/uploads"
files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb
@@ -148,7 +148,11 @@ directory node['gitlab']['gitlab-rails']['satellites_path'] do @@ -148,7 +148,11 @@ directory node['gitlab']['gitlab-rails']['satellites_path'] do
148 recursive true 148 recursive true
149 end 149 end
150 150
151 -env_vars = node['gitlab']['gitlab-rails']['env'] || {} 151 +env_vars = {
  152 + 'HOME' => node['gitlab']['user']['home'],
  153 + 'BUNDLE_GEMFILE' => File.join(gitlab_rails_source_dir, 'Gemfile')
  154 +}.merge(node['gitlab']['gitlab-rails']['env'])
  155 +
152 env_vars.each do |key, value| 156 env_vars.each do |key, value|
153 file File.join(gitlab_rails_env_dir, key) do 157 file File.join(gitlab_rails_env_dir, key) do
154 owner node['gitlab']['user']['username'] 158 owner node['gitlab']['user']['username']
files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb
@@ -4,4 +4,4 @@ cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working @@ -4,4 +4,4 @@ cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working
4 4
5 exec 2>&1 5 exec 2>&1
6 <%= render("mount_point_check.erb") %> 6 <%= render("mount_point_check.erb") %>
7 -exec chpst -e <%= node['gitlab']['gitlab-rails']['dir'] %>/etc/env -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails 7 +exec chpst -e <%= node['gitlab']['gitlab-rails']['dir'] %>/etc/env -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails
files/gitlab-cookbooks/gitlab/templates/default/sv-unicorn-run.erb
@@ -65,7 +65,7 @@ function is_unicorn @@ -65,7 +65,7 @@ function is_unicorn
65 function start_unicorn_master 65 function start_unicorn_master
66 { 66 {
67 <%= render("mount_point_check.erb") %> 67 <%= render("mount_point_check.erb") %>
68 - chpst -e <%= node['gitlab']['gitlab-rails']['dir'] %>/etc/env -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec unicorn -D -E <%= node['gitlab']['gitlab-rails']['environment'] %> -c <%= File.join(node['gitlab']['gitlab-rails']['dir'], "etc", "unicorn.rb") %> /opt/gitlab/embedded/service/gitlab-rails/config.ru 68 + chpst -e <%= node['gitlab']['gitlab-rails']['dir'] %>/etc/env -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /opt/gitlab/embedded/bin/bundle exec unicorn -D -E <%= node['gitlab']['gitlab-rails']['environment'] %> -c <%= File.join(node['gitlab']['gitlab-rails']['dir'], "etc", "unicorn.rb") %> /opt/gitlab/embedded/service/gitlab-rails/config.ru
69 } 69 }
70 70
71 function trap_signals 71 function trap_signals