Permalink
Browse files

Added support for centos/rhel systems which use /etc/sysconfig/memcached

  • Loading branch information...
1 parent 4a95e07 commit 6f7e2ea80057df1ed8be4a24cb85f572d7817ae8 @gitkeeps gitkeeps committed with jtimberman Mar 2, 2012
@@ -2,3 +2,4 @@
default[:memcached][:port] = 11211
default[:memcached][:user] = "nobody"
default[:memcached][:listen] = "0.0.0.0"
+default[:memcached][:maxconn] = "1024"
@@ -36,7 +36,24 @@
supports :status => true, :start => true, :stop => true, :restart => true
end
-template "/etc/memcached.conf" do
+case node[:platform]
+when "redhat","centos","fedora"
+ template "/etc/sysconfig/memcached" do
+ source "memcached.sysconfig.erb"
+ owner "root"
+ group "root"
+ mode "0644"
+ variables(
+ :listen => node[:memcached][:listen],
+ :user => node[:memcached][:user],
+ :port => node[:memcached][:port],
+ :maxconn => node[:memcached][:maxconn],
+ :memory => node[:memcached][:memory]
+ )
+ notifies :restart, resources(:service => "memcached"), :immediately
+ end
+else
+ template "/etc/memcached.conf" do
source "memcached.conf.erb"
owner "root"
group "root"
@@ -48,6 +65,7 @@
:memory => node[:memcached][:memory]
)
notifies :restart, resources(:service => "memcached"), :immediately
+ end
end
case node[:lsb][:codename]
@@ -0,0 +1,13 @@
+#
+# Configured by Chef. Logcal changes will be lost.
+#
+# "Javier Frias"<jfrias@gmail.com>
+#
+# centos sysconfig memcached default file
+#
+
+PORT="<%= @port %>"
+USER="<%= @user %>"
+MAXCONN="<%= @maxconn %>"
+CACHESIZE="<%= @memory %>"
+OPTIONS="-l <%= @listen %>"

0 comments on commit 6f7e2ea

Please sign in to comment.