Skip to content

Commit

Permalink
Merge pull request #1668 from chef/ma/update_runit
Browse files Browse the repository at this point in the history
Ma/update runit
  • Loading branch information
markan authored Jun 5, 2019
2 parents c3671b4 + bcda7d2 commit 493d800
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 38 deletions.
4 changes: 2 additions & 2 deletions omnibus/files/private-chef-cookbooks/Berksfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://supermarket.chef.io'

cookbook 'enterprise', git: 'https://github.com/chef-cookbooks/enterprise-chef-common', tag: 'v0.14.1'
cookbook 'enterprise', git: 'https://github.com/chef-cookbooks/enterprise-chef-common', tag: 'v0.15.1'
cookbook 'private-chef', path: './private-chef'
cookbook 'runit', '> 1.6.0'
cookbook 'runit' # we use the version locked in enterprise-chef-common
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ def dir_or_existing_parent(dir)
# If a pre-existing postgres service exists it will need to be shut
# down prior to running the upgrade step.
def shutdown_postgres
runit_service "postgresql" do
component_runit_service "postgresql" do
action :nothing # can this just be 'action :stop'?
end

log "Shutting down PostgreSQL for update" do
notifies :stop, "runit_service[postgresql]", :immediately
notifies :stop, "component_runit_service[postgresql]", :immediately
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
group OmnibusHelper.new(node).ownership['group']
mode "644"
variables(bookshelf_params)
notifies :restart, 'runit_service[bookshelf]' if is_data_master?
notifies :restart, 'component_runit_service[bookshelf]' if is_data_master?
end

link "/opt/opscode/embedded/service/bookshelf/sys.config" do
Expand All @@ -83,7 +83,7 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "644"
notifies :restart, 'runit_service[bookshelf]' if is_data_master?
notifies :restart, 'component_runit_service[bookshelf]' if is_data_master?
end

link "/opt/opscode/embedded/service/bookshelf/vm.args" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ChefServerDataBootstrap.new(node).bootstrap
end
not_if { OmnibusHelper.has_been_bootstrapped? }
notifies :restart, 'service[opscode-erchef]'
notifies :restart, 'component_runit_service[opscode-erchef]'
end

file OmnibusHelper.bootstrap_sentinel_file do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
# is an externally managed version. Given that bootstrap and
# opscode-expander are not externalizable, don't need special
# handling for them as we do in the normal disable case below.
runit_service service do
component_runit_service service do
action :disable
end
else
Expand All @@ -157,7 +157,7 @@
# bootstrap isn't a service, nothing to disable.
next if service == 'bootstrap'
# All non-enabled services get disabled;
runit_service service do
component_runit_service service do
action :disable
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_chef_backend_cluster_members
group OmnibusHelper.new(node).ownership['group']
mode "600"
variables(node['private_chef']['haproxy'].to_hash.merge(chef_backend_members: chef_backend_members))
notifies :restart, 'runit_service[haproxy]'
notifies :restart, 'component_runit_service[haproxy]'
end

component_runit_service "haproxy"
Expand Down Expand Up @@ -113,7 +113,7 @@ def get_chef_backend_cluster_members
Kernel.exit! 1
end
end
notifies :start, 'runit_service[haproxy]', :before
notifies :start, 'component_runit_service[haproxy]', :before
end

ruby_block "wait for backend leader to stabilize" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
# Note that due to JIT compile of lua resources, any
# changes to them will require a full restart to be picked up.
# This includes any embedded lua.
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end
end

Expand All @@ -191,12 +191,12 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
sensitive true
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end
elsif stats_passwd_file
file stats_passwd_file do
action :delete
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end
end

Expand All @@ -219,7 +219,7 @@
:compliance_proxy_regex => '(?:/compliance)?/organizations/([^/]+)/owners/([^/]+)/compliance(.*)'
)
)
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end
end

Expand All @@ -232,7 +232,7 @@
group 'root'
mode '0644'
variables(lbconf.merge(chef_lb_configs).merge(:temp_dir => nginx_tempfile_dir))
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end

# Write out README.md for addons dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
group OmnibusHelper.new(node).ownership['group']
mode "644"
variables(node['private_chef']['oc_bifrost'].to_hash)
notifies :restart, 'runit_service[oc_bifrost]'
notifies :restart, 'component_runit_service[oc_bifrost]'
end

link "/opt/opscode/embedded/service/oc_bifrost/sys.config" do
Expand All @@ -78,7 +78,7 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "644"
notifies :restart, 'runit_service[oc_bifrost]'
notifies :restart, 'component_runit_service[oc_bifrost]'
end

link "/opt/opscode/embedded/service/oc_bifrost/vm.args" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
group OmnibusHelper.new(node).ownership['group']
mode '640'
content mutable_hash.to_yaml
notifies :restart, 'runit_service[oc_id]'
notifies :restart, 'component_runit_service[oc_id]'
end

#
Expand All @@ -123,7 +123,7 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode '640'
notifies :restart, 'runit_service[oc_id]'
notifies :restart, 'component_runit_service[oc_id]'
end

secrets_file = "/opt/opscode/embedded/service/oc_id/config/initializers/secret_token.rb"
Expand All @@ -141,7 +141,7 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode '640'
notifies :restart, 'runit_service[oc_id]'
notifies :restart, 'component_runit_service[oc_id]'
end

database_file = "/opt/opscode/embedded/service/oc_id/config/database.yml"
Expand Down Expand Up @@ -227,6 +227,6 @@
owner "root"
group "root"
mode "0644"
notifies :restart, 'runit_service[nginx]'
notifies :restart, 'component_runit_service[nginx]'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
:helper => helper)
}
notifies :run, 'execute[remove_erchef_siz_files]', :immediately
notifies :restart, 'runit_service[opscode-erchef]'
notifies :restart, 'component_runit_service[opscode-erchef]'
end

# Erchef still ultimately uses disk_log [1] for request logging, and if
Expand Down Expand Up @@ -101,7 +101,7 @@
owner helper.ownership['owner']
group helper.ownership['group']
mode "644"
notifies :restart, 'runit_service[opscode-erchef]'
notifies :restart, 'component_runit_service[opscode-erchef]'
end

link "/opt/opscode/embedded/service/opscode-erchef/vm.args" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
mode "0644"
options = node['private_chef']['opscode-expander'].to_hash
variables(options)
notifies :restart, 'runit_service[opscode-expander]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-expander]' if is_data_master?
end

link "/opt/opscode/embedded/service/opscode-expander/conf/opscode-expander.rb" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "0644"
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
end

file File.join(solr_collection_dir, "core.properties") do
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "0644"
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
content <<EOF
name=collection1
EOF
Expand All @@ -84,15 +84,15 @@
group OmnibusHelper.new(node).ownership['group']
mode "0644"
variables(node['private_chef']['opscode-solr4'].to_hash)
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
end

cookbook_file File.join(solr_conf_dir, "schema.xml") do
source "solr4/schema.xml"
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "0644"
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
end

template File.join(solr_jetty_dir, "etc", "jetty.xml") do
Expand All @@ -101,15 +101,15 @@
mode "0644"
source "solr4/jetty.xml.erb"
variables(node['private_chef']['opscode-solr4'].to_hash.merge(node['private_chef']['logs'].to_hash))
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
end

template File.join(solr_jetty_dir, "contexts", "solr-jetty-context.xml") do
owner OmnibusHelper.new(node).ownership['owner']
group OmnibusHelper.new(node).ownership['group']
mode "0644"
source "solr4/solr-jetty-context.xml.erb"
notifies :restart, 'runit_service[opscode-solr4]' if is_data_master?
notifies :restart, 'component_runit_service[opscode-solr4]' if is_data_master?
end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,22 @@
# Upgrade the cluster if you gotta
private_chef_pg_upgrade "upgrade_if_necessary"

component_runit_service "postgresql" do
control ['t']
end

#
# This is delayed because we sometimes need to restart oc_erchef and other clients to release the connections and allow a restart.
#
private_chef_pg_cluster postgresql_data_dir do
notifies :restart, 'runit_service[postgresql]' if is_data_master?
notifies :restart, 'component_runit_service[postgresql]', :delayed if is_data_master?
end

link postgresql_data_dir_symlink do
to postgresql_data_dir
not_if { postgresql_data_dir == postgresql_data_dir_symlink }
end

component_runit_service "postgresql" do
control ['t']
end

# NOTE: These recipes are written idempotently, but require a running
# PostgreSQL service. They should run each time (on the appropriate
# backend machine, of course), because they also handle schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@
user opc_username
not_if rabbitmq_management_is_up
# management plugin needs a rabbit restart
notifies :restart, 'runit_service[rabbitmq]', :delayed
notifies :restart, 'component_runit_service[rabbitmq]', :delayed
retries 10
end
else
execute "#{rmq_plugins} disable rabbitmq_management" do
environment (rabbitmq_env)
user opc_username
notifies :restart, 'runit_service[rabbitmq]', :delayed
notifies :restart, 'component_runit_service[rabbitmq]', :delayed
only_if rabbitmq_management_is_up
retries 10
end
Expand Down

0 comments on commit 493d800

Please sign in to comment.