Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding GOMAXPROCS support for systemd. #188

Merged
merged 2 commits into from
Jun 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
default['consul']['service_user'] = 'root'
default['consul']['service_group'] = 'root'
end
default['consul']['system_account'] = false

default['consul']['ports'] = {
'dns' => 8600,
Expand Down
8 changes: 8 additions & 0 deletions recipes/_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
username consul_user
home '/dev/null'
shell '/bin/false'
system node['consul']['system_account']
comment 'consul service user'
end

Expand All @@ -46,6 +47,7 @@
not_if { consul_group == 'root' }
group_name consul_group
members consul_user
system node['consul']['system_account']
append true
end

Expand Down Expand Up @@ -248,6 +250,12 @@
reload_command "'#{node['runit']['sv_bin']}' hup consul"
end
when 'systemd'
template node['consul']['etc_config_dir'] do
source 'consul-sysconfig.erb'
mode 0644
notifies :create, "template[/etc/systemd/system/consul.service]", :immediately
end

template '/etc/systemd/system/consul.service' do
source 'consul-systemd.erb'
mode 0644
Expand Down
3 changes: 2 additions & 1 deletion templates/default/consul-systemd.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ After=basic.target network.target
[Service]
User=<%= node['consul']['service_user'] %>
Group=<%= node['consul']['service_group'] %>
EnvironmentFile=-<%= node['consul']['etc_config_dir'] %>
ExecStart=<%= Chef::Consul.active_binary(node) %> agent \
-config-dir <%= node['consul']['config_dir'] %>
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s
RestartSec=15s

This comment was marked as outdated.

This comment was marked as outdated.


[Install]
WantedBy=multi-user.target