Skip to content

Commit

Permalink
* For default (www) pool, put example in /var/run so that it works fo…
Browse files Browse the repository at this point in the history
…r Debian and RHEL-based platforms

* Start/restart PHP-FPM at end of run to apply changes
  • Loading branch information
ameir committed Apr 9, 2013
1 parent 2f33c98 commit b7d128c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
group = "www-data"
conf_dir = "/etc/php5/fpm"
conf_file = "/etc/php5/fpm/php-fpm.conf"
error_log = "/var/log/php5-fpm.log"
error_log = "/var/log/php5-fpm.log"
pid ="/var/run/php5-fpm.pid"
end

Expand All @@ -22,7 +22,7 @@

default['php-fpm']['pools'] = ["www","testpool"]

default['php-fpm']['pool']['www']['listen'] = "/var/run/php-fpm/www.sock"
default['php-fpm']['pool']['www']['listen'] = "/var/run/php-fpm-www.sock"
default['php-fpm']['pool']['www']['allowed_clients'] = ["127.0.0.1"]
default['php-fpm']['pool']['www']['user'] = user
default['php-fpm']['pool']['www']['group'] = group
Expand Down
4 changes: 0 additions & 4 deletions definitions/fpm_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,5 @@
:max_requests => node['php-fpm']['pool'][pool_name]['max_requests'],
:params => params
)
if ::File.exists?(conf_file)
notifies :restart, resources(:service => params[:php_fpm_service_name]), :delayed
end
end

end
11 changes: 6 additions & 5 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@
action :upgrade
end

service php_fpm_service_name do
supports :status => true, :restart => true, :reload => true
action [ :enable, :nothing ]
end

template node['php-fpm']['conf_file'] do
source "php-fpm.conf.erb"
mode 00644
Expand All @@ -104,3 +99,9 @@
php_fpm_service_name php_fpm_service_name
end
end

service "php-fpm" do
service_name php_fpm_service_name
supports :start => true, :stop => true, :restart => true, :reload => true
action [ :enable, :restart ]
end

0 comments on commit b7d128c

Please sign in to comment.