Ajout : vm_remote : rule_gpg .
[lhc/ateliers.git] / etc / sv / php5-fpm / configure.sh
index 5639822..25187a7 100644 (file)
@@ -1,7 +1,7 @@
-rule apt_get_install php5-fpm php-apc
+rule apt_get_install php5-fpm php-apc php5-mysql php5-gd
 rule insserv_remove  php5-fpm
 
-rule www_configure
+rule _www_configure
 
 rule adduser php5 \
  --disabled-login \
@@ -20,29 +20,32 @@ rule adduser log-php5 \
 sudo ln -fns \
  /etc/php5/fpm \
  /home/www/etc/php5
-sudo rm -rf \
- /etc/php5/fpm/conf.d \
- /etc/php5/fpm/pool.d
 sudo install -d -m 770 -o php5 -g php5 \
  /etc/php5/fpm/conf.d \
  /etc/php5/fpm/pool.d
 sudo install -m 440 -o php5 -g php5 \
  "$tool"/etc/php5/fpm/php-fpm.conf \
         /etc/php5/fpm/php-fpm.conf
-local conf
-#for conf in "$tool"/etc/php5/fpm/conf.d/*.conf
-# do conf=${conf#"$tool"/etc/php5/fpm/conf.d/}
-#      sudo install -m 660 -o php5 -g php5 \
-#       "$tool"/etc/php5/fpm/conf.d/"$conf" \
-#              /etc/php5/fpm/conf.d/"$conf"
-# done
-for conf in "$tool"/etc/php5/fpm/pool.d/*.conf
- do conf=${conf#"$tool"/etc/php5/fpm/pool.d/}
-       IFS=. read -r pool <<-EOF
-               ${conf%.conf}
-               EOF
-       assert 'test "${pool:+set}"'
-       rule adduser php5-"$pool" \
+sudo install -m 664 -o php5 -g php5 \
+ "$tool"/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 \
+        -mindepth 1 -maxdepth 1 -type f \
+        -name '*.conf' \
+        -printf '%f\n')
+ do
+       sudo install -m 660 -o php5 -g php5 \
+        "$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}
+       rule adduser php5_"$pool" \
         --disabled-login \
         --disabled-password \
         --group \
@@ -73,7 +76,7 @@ for conf in "$tool"/etc/php5/fpm/pool.d/*.conf
                env[TEMP] = /tmp
                env[TMPDIR] = /tmp
                env[TMP] = /tmp
-               group = php5-$pool
+               group = php5_$pool
                #listen = 127.0.0.1:9000
                listen = /run/php5/fpm/$pool
                #listen.allowed_clients = 127.0.0.1
@@ -93,10 +96,7 @@ for conf in "$tool"/etc/php5/fpm/pool.d/*.conf
                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/"$conf")
+               user = php5_$pool
+               $(cat "$tool"/etc/php5/fpm/pool.d/"$pool".conf)
                EOF
-       sudo install -m 664 -o php5 -g php5 \
-        "$tool"/etc/php5/fpm/php.ini \
-               /etc/php5/fpm/php.ini
  done