1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

[enh] Pass user/group to php-fpm.conf and remove old dir at upgrade

This commit is contained in:
Jérôme Lebleu 2016-05-14 21:52:20 +02:00
parent ae751145b2
commit 2994c1e80c
3 changed files with 8 additions and 5 deletions

View file

@ -8,8 +8,8 @@ listen.group = www-data
listen.mode = 0600 listen.mode = 0600
; Unix user/group of processes. ; Unix user/group of processes.
user = #POOLNAME# user = #USER#
group = #POOLNAME# group = #GROUP#
; Choose how the process manager will control the number of child processes. ; Choose how the process manager will control the number of child processes.
pm = dynamic pm = dynamic

View file

@ -78,6 +78,8 @@ sudo cp ../conf/nginx.conf "$nginx_conf"
# Copy and set php-fpm configuration # Copy and set php-fpm configuration
phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" 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@#POOLNAME#@${app}@g" ../conf/php-fpm.conf
sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf "$phpfpm_conf" sudo cp ../conf/php-fpm.conf "$phpfpm_conf"

View file

@ -46,6 +46,8 @@ sudo cp ../conf/nginx.conf "$nginx_conf"
# Copy and set php-fpm configuration # Copy and set php-fpm configuration
phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" 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@#POOLNAME#@${app}@g" ../conf/php-fpm.conf
sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf "$phpfpm_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" && sudo cp -a "${DESTDIR}/apps/$a" "${TMPDIR}/apps/$a"
done done
# Rename current directory and move new one # Rename existing app directory and move new one
sudo rm -rf "${DESTDIR}-old" sudo rm -rf "${DESTDIR}"
sudo mv "$DESTDIR" "${DESTDIR}-old"
sudo mv "$TMPDIR" "$DESTDIR" sudo mv "$TMPDIR" "$DESTDIR"
# Set app folders ownership # Set app folders ownership