From 2994c1e80c7646056d7642cb3128650bbe290d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 14 May 2016 21:52:20 +0200 Subject: [PATCH] [enh] Pass user/group to php-fpm.conf and remove old dir at upgrade --- conf/php-fpm.conf | 4 ++-- scripts/install | 2 ++ scripts/upgrade | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 1c9053c..e9e1a3b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -8,8 +8,8 @@ listen.group = www-data listen.mode = 0600 ; Unix user/group of processes. -user = #POOLNAME# -group = #POOLNAME# +user = #USER# +group = #GROUP# ; Choose how the process manager will control the number of child processes. pm = dynamic diff --git a/scripts/install b/scripts/install index 38be2ef..324c123 100755 --- a/scripts/install +++ b/scripts/install @@ -78,6 +78,8 @@ sudo cp ../conf/nginx.conf "$nginx_conf" # Copy and set php-fpm configuration phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" +sed -i "s@#USER#@${app}@g" ../conf/php-fpm.conf +sed -i "s@#GROUP#@${app}@g" ../conf/php-fpm.conf sed -i "s@#POOLNAME#@${app}@g" ../conf/php-fpm.conf sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf sudo cp ../conf/php-fpm.conf "$phpfpm_conf" diff --git a/scripts/upgrade b/scripts/upgrade index 8a8cf35..f758276 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,6 +46,8 @@ sudo cp ../conf/nginx.conf "$nginx_conf" # Copy and set php-fpm configuration phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" +sed -i "s@#USER#@${app}@g" ../conf/php-fpm.conf +sed -i "s@#GROUP#@${app}@g" ../conf/php-fpm.conf sed -i "s@#POOLNAME#@${app}@g" ../conf/php-fpm.conf sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf sudo cp ../conf/php-fpm.conf "$phpfpm_conf" @@ -83,9 +85,8 @@ for a in $(sudo ls "${DESTDIR}/apps"); do && sudo cp -a "${DESTDIR}/apps/$a" "${TMPDIR}/apps/$a" done -# Rename current directory and move new one -sudo rm -rf "${DESTDIR}-old" -sudo mv "$DESTDIR" "${DESTDIR}-old" +# Rename existing app directory and move new one +sudo rm -rf "${DESTDIR}" sudo mv "$TMPDIR" "$DESTDIR" # Set app folders ownership