Skip to content

Commit 49ddd9f

Browse files
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"
1 parent c975c8b commit 49ddd9f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Disable Strict Host checking for non interactive git clones
44

55
mkdir -p -m 0700 /root/.ssh
6+
# Prevent config files from being filled to infinity by force of stop and restart the container
7+
echo "" > /root/.ssh/config
8+
/usr/local/etc/php-fpm.conf
9+
610
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
711

812
if [[ "$GIT_USE_SSH" == "1" ]] ; then
@@ -75,6 +79,13 @@ if [ -f /var/www/html/conf/nginx/nginx-site-ssl.conf ]; then
7579
cp /var/www/html/conf/nginx/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
7680
fi
7781

82+
83+
# Prevent config files from being filled to infinity by force of stop and restart the container
84+
lastlinephpconf="$(grep "." ./run_example.sh | tail -1)"
85+
if [[ $lastlinephpconf == *"php_flag[display_errors]"* ]]; then
86+
sed '$' /usr/local/etc/php-fpm.conf
87+
fi
88+
7889
# Display PHP error's or not
7990
if [[ "$ERRORS" != "1" ]] ; then
8091
echo php_flag[display_errors] = off >> /usr/local/etc/php-fpm.conf

0 commit comments

Comments
 (0)