Merge branch 'mailroom_restart' into 'master'

Mailroom restart

It is safe to restart mailroom every time GitLab restarts unicorn too so just add service restart if mailroom is enabled.

Fixes #1056 

See merge request !622
This commit is contained in:
Marin Jankovski 2016-01-29 13:45:13 +00:00
commit f77dcfe994
3 changed files with 10 additions and 4 deletions

View File

@ -15,6 +15,12 @@
# limitations under the License.
#
# IMPORTANT:
# When using template_symlink restarts property
# be aware that any additional "notifies :restart" outside of this property
# will be IGNORED.
# You must specify EITHER one restarts property OR multiple "notifies :restart"
define :template_symlink, :link_from => nil, :source => nil, :owner => nil, :group => nil, :mode => nil, :variables => nil, :helpers => nil, :notifies => nil, :restarts => [], :action => :create do
template params[:name] do
source params[:source]

View File

@ -80,7 +80,8 @@ include_recipe "gitlab::selinux"
"unicorn",
"ci-unicorn",
"sidekiq",
"ci-sidekiq"
"ci-sidekiq",
"mailroom"
].each do |dummy|
service dummy do
supports []

View File

@ -109,6 +109,7 @@ template File.join(gitlab_rails_static_etc_dir, "gitlab-rails-rc")
dependent_services = []
dependent_services << "service[unicorn]" if OmnibusHelper.should_notify?("unicorn")
dependent_services << "service[sidekiq]" if OmnibusHelper.should_notify?("sidekiq")
dependent_services << "service[mailroom]" if node['gitlab']['mailroom']['enable']
redis_not_listening = OmnibusHelper.not_listening?("redis")
postgresql_not_listening = OmnibusHelper.not_listening?("postgresql")
@ -238,9 +239,7 @@ template_symlink File.join(gitlab_rails_etc_dir, "gitlab.yml") do
)
)
restarts dependent_services
unless redis_not_listening
notifies :run, 'execute[clear the gitlab-rails cache]'
end
notifies :run, 'execute[clear the gitlab-rails cache]' unless redis_not_listening
end
template_symlink File.join(gitlab_rails_etc_dir, "rack_attack.rb") do