Skip to content

Commit

Permalink
Fix log must not use INIT if not into INIT method
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 11, 2024
1 parent 4d08de2 commit 9d5533c
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 40 deletions.
12 changes: 7 additions & 5 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,26 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
Expand Down
13 changes: 8 additions & 5 deletions images/15.0.3-php7.4/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,23 +405,26 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
Expand Down
13 changes: 8 additions & 5 deletions images/16.0.5-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down
13 changes: 8 additions & 5 deletions images/17.0.4-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down
13 changes: 8 additions & 5 deletions images/18.0.6-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down
13 changes: 8 additions & 5 deletions images/19.0.4-php8.2/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down
13 changes: 8 additions & 5 deletions images/20.0.2-php8.2/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down
13 changes: 8 additions & 5 deletions images/develop/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,27 @@ function run()
fi
fi

# Run scripts before starting
runScripts "before-starting.d"

# Set permission
local CURRENT_UID=$(id -u www-data)
local CURRENT_GID=$(id -g www-data)
usermod -u ${WWW_USER_ID} www-data
groupmod -g ${WWW_GROUP_ID} www-data

if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then
# Refresh file ownership cause it has changed
echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..."
echo "As UID / GID have changed from default, update ownership for files in /var/ww ..."
chown -R www-data:www-data /var/www
else
# Reducing load on init : change ownership only for volumes declared in docker
echo "[INIT] => update ownership for files in /var/www/documents ..."
echo "Update ownership for files in /var/www/documents ..."
chown -R www-data:www-data /var/www/documents
fi


# Run scripts before starting
runScripts "before-starting.d"


echo
echo "*** You can connect to the docker Mariadb with:"
echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash"
Expand Down

0 comments on commit 9d5533c

Please sign in to comment.