Skip to content

Commit

Permalink
Merge pull request #39 from tehranian/fix-upstart-conf
Browse files Browse the repository at this point in the history
Fix the GOMAXPROCS warning for Upstart-based systems
  • Loading branch information
solarkennedy committed Oct 28, 2014
2 parents f25fb6a + 655b9f5 commit a7e8a5b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Kyle Anderson <kyle@xkyle.com>
Kenny Gatdula <kennygatdula@gmail.com>
Simon Croome <simon@croome.org>
Simon Croome <simon@croome.org>
Dan Tehranian <tehranian@gmail.com>
2 changes: 1 addition & 1 deletion spec/acceptance/standard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class { 'consul':
end

describe command('consul version') do
it { should return_stdout /Consul v0\.2\.0/ }
it { should return_stdout /Consul v0\.4\.1/ }
end

end
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/ui_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class { 'consul':
end

describe file('/opt/consul/ui') do
it { should be_linked_to '/opt/consul/0.2.0_web_ui' }
it { should be_linked_to '/opt/consul/0.4.1_web_ui' }
end

describe service('consul') do
Expand All @@ -39,7 +39,7 @@ class { 'consul':
it { should contain_service('mysql-server').with_ensure('present') }

describe command('consul version') do
it { should return_stdout /Consul v0\.2\.0/ }
it { should return_stdout /Consul v0\.4\.1/ }
end

end
Expand Down
9 changes: 8 additions & 1 deletion templates/consul.upstart.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ stop on runlevel [06]
env CONSUL=<%= scope.lookupvar('consul::bin_dir') %>/consul
env CONFIG=<%= scope.lookupvar('consul::config_dir') %>

exec sudo -u <%= scope.lookupvar('consul::user') %> -g <%= scope.lookupvar('consul::group') %> $CONSUL agent -config-dir $CONFIG <%= scope.lookupvar('consul::extra_options') %>

script
# read settings like GOMAXPROCS from "/etc/default/consul", if available.
[ -e /etc/default/consul ] && . /etc/default/consul

export GOMAXPROCS=${GOMAXPROCS:-2}
exec sudo -u <%= scope.lookupvar('consul::user') %> -g <%= scope.lookupvar('consul::group') %> $CONSUL agent -config-dir $CONFIG <%= scope.lookupvar('consul::extra_options') %>
end script

respawn
respawn limit 10 10
Expand Down

0 comments on commit a7e8a5b

Please sign in to comment.