X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=etc%2Fsv%2Fphp5-fpm%2Flocal.sh;h=5d99315cf15193a5c368f7568a5d5af9526653bb;hp=089a41a77f8fa8fccb72ee012419e342e781d8e6;hb=9075978ae94310fa7a27d9881d3cecc6150ca3e9;hpb=3ad6118386977e346d81042e924e5db9c5f15b7d diff --git a/etc/sv/php5-fpm/local.sh b/etc/sv/php5-fpm/local.sh index 089a41a..5d99315 100644 --- a/etc/sv/php5-fpm/local.sh +++ b/etc/sv/php5-fpm/local.sh @@ -28,7 +28,7 @@ sudo install -m 440 -o php5 -g php5 \ /etc/php5/fpm/php-fpm.conf sudo install -m 664 -o php5 -g php5 \ "$tool"/etc/php5/fpm/php.ini \ - /etc/php5/fpm/php.ini + /etc/php5/fpm/php.ini for conf in $( test ! -d "$tool"/etc/php5/fpm/conf.d || find "$tool"/etc/php5/fpm/conf.d \ @@ -40,20 +40,23 @@ for conf in $( "$tool"/etc/php5/fpm/conf.d/"$conf" \ /etc/php5/fpm/conf.d/"$conf" done -for pool in $(find "$tool"/etc/php5/fpm/pool.d/ \ - -mindepth 1 -maxdepth 1 -type d \ - -false ${@:+$(printf -- '-or -name %s.conf\n' "$@")} \ - -printf '%f\n') - do pool=${pool%\.conf} - "$tool"/local/adduser php5_"$pool" \ +for pool in $( + find "$tool"/etc/php5/fpm/pool.d/ \ + -mindepth 2 -maxdepth 2 -type f \ + -name "php-fpm.conf" \ + -printf '%P\n') + do pool=${pool%\/php-fpm\.conf} + "$tool"/local/adduser php_"$pool" \ --disabled-login \ --disabled-password \ --group \ --no-create-home \ - --home /etc/php5/fpm/pool.d \ + --home /etc/php5/fpm/pool.d/"$pool" \ --shell /bin/false \ --system - "$tool"/local/adduser log-php5-"$pool" \ + sudo install -d -m 770 -o php5 -g php5 \ + /etc/php5/fpm/pool.d/"$pool" + "$tool"/local/adduser log-php-"$pool" \ --disabled-login \ --disabled-password \ --group \ @@ -61,22 +64,22 @@ for pool in $(find "$tool"/etc/php5/fpm/pool.d/ \ --home /home/www/log/php5/fpm/"$pool" \ --shell /bin/false \ --system - sudo install -d -m 770 -o log-php5 -g log-php5 \ + sudo install -d -m 1771 -o log-php5 -g log-php5 \ /home/www/log/php5 \ /home/www/log/php5/fpm - sudo install -d -m 770 -o log-php5-"$pool" -g log-php5-"$pool" \ + sudo install -d -m 2770 -o log-php-"$pool" -g log-php-"$pool" \ /home/www/log/php5/fpm/"$pool" sudo install -m 660 -o php5 -g php5 /dev/stdin \ - /etc/php5/fpm/pool.d/"$pool".conf <<-EOF + /etc/php5/fpm/pool.d/"$pool"/php-fpm.conf <<-EOF [$pool] access.log = /home/www/log/php5/fpm/$pool/access.log - catch_workers_output = yes + catch_workers_output = no chdir = / env[HOSTNAME] = \$HOSTNAME env[TEMP] = /tmp env[TMPDIR] = /tmp env[TMP] = /tmp - group = php5_$pool + group = php_$pool #listen = 127.0.0.1:9000 listen = /run/php5/fpm/$pool #listen.allowed_clients = 127.0.0.1 @@ -84,6 +87,7 @@ for pool in $(find "$tool"/etc/php5/fpm/pool.d/ \ listen.mode = 0660 #listen.owner = www-data listen.backlog = -1 + ping.path = /ping pm = dynamic pm.max_children = 5 pm.max_requests = 200 @@ -96,7 +100,7 @@ for pool in $(find "$tool"/etc/php5/fpm/pool.d/ \ rlimit_core = unlimited rlimit_files = 131072 slowlog = /home/www/log/php5/fpm/$pool/slow.log - user = php5_$pool - $(cat "$tool"/etc/php5/fpm/pool.d/"$pool".conf) + user = php_$pool + $(cat "$tool"/etc/php5/fpm/pool.d/"$pool"/php-fpm.conf) EOF done