From 1f09a78c756382a812fb5c324c9bbfc25dc9a46a Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 28 Aug 2014 10:58:09 +0200 Subject: [PATCH] Move socket directory creation to unicorn section. --- files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb | 7 ------- files/gitlab-cookbooks/gitlab/recipes/unicorn.rb | 8 +++++++- files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb b/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb index f4f6c04..0a4d888 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb @@ -47,13 +47,6 @@ directory gitlab_rails_dir do recursive true end -directory File.join(gitlab_rails_dir, "sockets") do - owner node['gitlab']['user']['username'] - group node['gitlab']['webserver']['username'] - mode '0770' - recursive true -end - directory gitlab_rails_public_uploads_dir do owner node['gitlab']['user']['username'] group node['gitlab']['webserver']['username'] diff --git a/files/gitlab-cookbooks/gitlab/recipes/unicorn.rb b/files/gitlab-cookbooks/gitlab/recipes/unicorn.rb index 4fb8c55..76b0b2a 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/unicorn.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/unicorn.rb @@ -27,7 +27,6 @@ unicorn_socket_dir = File.dirname(unicorn_listen_socket) [ unicorn_log_dir, - unicorn_socket_dir, File.dirname(unicorn_pidfile) ].each do |dir_name| directory dir_name do @@ -37,6 +36,13 @@ unicorn_socket_dir = File.dirname(unicorn_listen_socket) end end +directory unicorn_socket_dir do + owner node['gitlab']['user']['username'] + group node['gitlab']['webserver']['username'] + mode '0750' + recursive true +end + unicorn_listen_tcp = node['gitlab']['unicorn']['listen'] unicorn_listen_tcp << ":#{node['gitlab']['unicorn']['port']}" diff --git a/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb b/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb index 4672ee0..746b5dd 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb @@ -2,7 +2,7 @@ # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`. -user <%= node['gitlab']['user']['username'] %> <%= node['gitlab']['webserver']['username']%>; +user <%= node['gitlab']['webserver']['username'] %> <%= node['gitlab']['webserver']['username']%>; worker_processes <%= @worker_processes %>; error_log /var/log/gitlab/nginx/error.log; pid /var/opt/gitlab/nginx/nginx.pid; -- libgit2 0.21.2