Skip to content

Commit

Permalink
add logfilepath attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith committed Jul 21, 2015
1 parent 742e271 commit 22dd818
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
default['memcached']['listen'] = '0.0.0.0'
default['memcached']['maxconn'] = 1024
default['memcached']['max_object_size'] = '1m'
default['memcached']['logfilepath'] = '/var/log/'
default['memcached']['logfilename'] = 'memcached.log'

case node['platform_family']
Expand Down
18 changes: 9 additions & 9 deletions definitions/memcached_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
default_logger true
cookbook 'memcached'
options({
:memory => node['memcached']['memory'],
:port => node['memcached']['port'],
:udp_port => node['memcached']['udp_port'],
:listen => node['memcached']['listen'],
:maxconn => node['memcached']['maxconn'],
:user => node['memcached']['user'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size'],
:memory => node['memcached']['memory'],
:port => node['memcached']['port'],
:udp_port => node['memcached']['udp_port'],
:listen => node['memcached']['listen'],
:maxconn => node['memcached']['maxconn'],
:user => node['memcached']['user'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size'],
:experimental_options => Array(node['memcached']['experimental_options']),
:ulimit => node['memcached']['ulimit']
:ulimit => node['memcached']['ulimit']
}.merge(opts))
end
end
4 changes: 4 additions & 0 deletions recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# limitations under the License.
#

directory node['memcached']['logfilepath']

service 'memcached' do
action :enable
supports :status => true, :start => true, :stop => true, :restart => true, :enable => true
Expand All @@ -38,6 +40,7 @@
:udp_port => node['memcached']['udp_port'],
:maxconn => node['memcached']['maxconn'],
:memory => node['memcached']['memory'],
:logfilepath => node['memcached']['logfilepath'],
:logfilename => node['memcached']['logfilename'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size']
Expand All @@ -63,6 +66,7 @@
:udp_port => node['memcached']['udp_port'],
:maxconn => node['memcached']['maxconn'],
:memory => node['memcached']['memory'],
:logfilepath => node['memcached']['logfilepath'],
:logfilename => node['memcached']['logfilename'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size'],
Expand Down
2 changes: 1 addition & 1 deletion templates/default/memcached.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-d

# Log memcached's output to /var/log/memcached
logfile /var/log/<%= @logfilename %>
logfile <%= @logfilepath %><%= @logfilename %>

# Be verbose
-v
Expand Down

0 comments on commit 22dd818

Please sign in to comment.