diff --git a/mattermost/hooks/init b/mattermost/hooks/init index c27e453b..c29d44c0 100755 --- a/mattermost/hooks/init +++ b/mattermost/hooks/init @@ -11,9 +11,6 @@ ## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service -# Please note that postgres detect on its own if its datadir needs to be populated - - ## ## checking permission of base directory ## @@ -21,6 +18,10 @@ dirs=("$SERVICE_CONFIGSTORE/mattermost/"{config,plugins} "$SERVICE_DATASTORE/mattermost/"{data,logs}) for dir in "${dirs[@]}"; do mkdir -p "$dir" - find "$dir" \! -uid 2000 -exec chown -v 2000 {} \; - find "$dir" \! -gid 2000 -exec chgrp -v 2000 {} \; + find "$dir" \! -uid 2000 -print0 | while read-0 f; do + chown -v 2000 "$f" + done + find "$dir" \! -gid 2000 -print0 | while read-0 f; do + chgrp -v 2000 "$f" + done done