From 011c1bf56fbf5b8e5bd5610d4de0bf518a089ddd Mon Sep 17 00:00:00 2001 From: Brandt Kurowski Date: Thu, 11 Dec 2025 10:57:52 -0500 Subject: [PATCH] fix log permissions --- local/bin/db-rebuild.sh | 5 ++++- local/etc/uceap.d/devcontainer_on_create.sh | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/local/bin/db-rebuild.sh b/local/bin/db-rebuild.sh index 11805fc..6025cf8 100755 --- a/local/bin/db-rebuild.sh +++ b/local/bin/db-rebuild.sh @@ -157,4 +157,7 @@ echo "Import completed with status code $?" # update db with latest code/config changes echo "Running drush:$DRUSHTASK to update DB with latest configs and baseline migrations." -eval "cd $WEBROOT && drush $DRUSHTASK" \ No newline at end of file +eval "cd $WEBROOT && drush $DRUSHTASK" + +# In case the drush command generated a new log file as the current user, make sure httpd can write to it +chmod -R g+w web/sites/default/files/private/logs diff --git a/local/etc/uceap.d/devcontainer_on_create.sh b/local/etc/uceap.d/devcontainer_on_create.sh index 14310f3..2ab40fe 100644 --- a/local/etc/uceap.d/devcontainer_on_create.sh +++ b/local/etc/uceap.d/devcontainer_on_create.sh @@ -1,8 +1,7 @@ function devcontainer_on_create() { # Change default umask and add user to web group so we can share write permission on web files sed -i 's/^#umask\s*022/umask 002/' ~/.profile - echo "umask 002" >>~/.zshrc - echo "umask 002" >>~/.bashrc + echo "umask 002" | tee -a ~/.bashrc ~/.zshrc ~/.zshrc.local # the first time we run this script the default umask is still in effect, # which messes up permissions on the log file that gets created when we run drush deploy @@ -58,6 +57,9 @@ function devcontainer_on_create() { # The database image might be out of date so deploy any new changes from code vendor/bin/drush deploy + # If the drush command generated a log file as the current user, make sure httpd can write to it + chmod -R g+w web/sites/default/files/private/logs + # Setup drush and other vendor binaries echo "export PATH=\"$(pwd)/vendor/bin:\$PATH\"" | tee -a ~/.bashrc ~/.zshrc ~/.zshrc.local