From 49ddd9fe3e177131a50994e4a69fd3a6bbcb6d03 Mon Sep 17 00:00:00 2001 From: thelittlefireman Date: Fri, 7 Apr 2017 09:43:19 +0200 Subject: [PATCH 1/3] Prevent config files from being filled to infinity When you start/stop Successively your container, the file /root/.ssh/conf and /usr/local/etc/php-fpm.conf grow to infinity : loop repetition of line "; Include one or more files. If glob(3) exists, it is used to include a bunch of ; files from a glob(3) pattern. This directive can be used everywhere in the ; file. ; Relative path can also be used. They will be prefixed by: ; - the global prefix if it's been set (-p argument) ; - /usr/local otherwise include=etc/php-fpm.d/*.conf php_flag[display_errors] = off php_flag[display_errors] = off php_flag[display_errors] = off php_flag[display_errors] = off php_flag[display_errors] = off" --- scripts/start.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/start.sh b/scripts/start.sh index 30095d1..4d4a91d 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -3,6 +3,10 @@ # Disable Strict Host checking for non interactive git clones mkdir -p -m 0700 /root/.ssh +# Prevent config files from being filled to infinity by force of stop and restart the container +echo "" > /root/.ssh/config +/usr/local/etc/php-fpm.conf + echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config if [[ "$GIT_USE_SSH" == "1" ]] ; then @@ -75,6 +79,13 @@ if [ -f /var/www/html/conf/nginx/nginx-site-ssl.conf ]; then cp /var/www/html/conf/nginx/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf fi + +# Prevent config files from being filled to infinity by force of stop and restart the container +lastlinephpconf="$(grep "." ./run_example.sh | tail -1)" +if [[ $lastlinephpconf == *"php_flag[display_errors]"* ]]; then + sed '$' /usr/local/etc/php-fpm.conf +fi + # Display PHP error's or not if [[ "$ERRORS" != "1" ]] ; then echo php_flag[display_errors] = off >> /usr/local/etc/php-fpm.conf From 3bc935e817f09ca83528203c725489dcea499719 Mon Sep 17 00:00:00 2001 From: thelittlefireman Date: Fri, 7 Apr 2017 09:44:49 +0200 Subject: [PATCH 2/3] fix bad copy past fix bad copy past --- scripts/start.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 4d4a91d..781530b 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -5,8 +5,6 @@ mkdir -p -m 0700 /root/.ssh # Prevent config files from being filled to infinity by force of stop and restart the container echo "" > /root/.ssh/config -/usr/local/etc/php-fpm.conf - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config if [[ "$GIT_USE_SSH" == "1" ]] ; then From 157a1c27f197c858c49124f1527b2ac76523b816 Mon Sep 17 00:00:00 2001 From: thelittlefireman Date: Fri, 23 Jun 2017 11:02:47 +0200 Subject: [PATCH 3/3] fix huge mistake : bad copy past and missing parameters --- scripts/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 781530b..9d4cabb 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -79,9 +79,9 @@ fi # Prevent config files from being filled to infinity by force of stop and restart the container -lastlinephpconf="$(grep "." ./run_example.sh | tail -1)" +lastlinephpconf="$(grep "." /usr/local/etc/php-fpm.conf | tail -1)" if [[ $lastlinephpconf == *"php_flag[display_errors]"* ]]; then - sed '$' /usr/local/etc/php-fpm.conf + sed -i '$ d' /usr/local/etc/php-fpm.conf fi # Display PHP error's or not