Browse Source

fix: [mongo,odoo-tecnativa,mattermost,peertube,synapse,rocketchat,redis] avoid using ``find``'s ``-exec`` option as it fails

With large compose, shell environment is too big to be handled correctly
by ``find``.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
0k/dev/master
Valentin Lab 5 years ago
parent
commit
55de9c1909
  1. 4
      mattermost/hooks/init
  2. 5
      mongo/hooks/init
  3. 4
      odoo-tecnativa/hooks/init
  4. 6
      peertube/hooks/init
  5. 6
      redis/hooks/init
  6. 6
      rocketchat/hooks/init
  7. 8
      synapse/lib/common

4
mattermost/hooks/init

@ -19,9 +19,9 @@ dirs=("$SERVICE_CONFIGSTORE/mattermost/"{config,plugins} "$SERVICE_DATASTORE/mat
for dir in "${dirs[@]}"; do for dir in "${dirs[@]}"; do
mkdir -p "$dir" mkdir -p "$dir"
find "$dir" \! -uid 2000 -print0 | while read-0 f; do find "$dir" \! -uid 2000 -print0 | while read-0 f; do
chown -v 2000 "$f"
chown -v 2000 "$f" || exit 1
done done
find "$dir" \! -gid 2000 -print0 | while read-0 f; do find "$dir" \! -gid 2000 -print0 | while read-0 f; do
chgrp -v 2000 "$f"
chgrp -v 2000 "$f" || exit 1
done done
done done

5
mongo/hooks/init

@ -39,8 +39,9 @@ for dir in "${dirs[@]}"; do
done done
mkdir -p "${host_dirs[@]}" mkdir -p "${host_dirs[@]}"
find "${host_dirs[@]}" \! -user "$uid" \
-exec chown -v "$uid" {} + || true
find "${host_dirs[@]}" \! -user "$uid" -print0 | while read-0 f; do
chown -v "$uid" "$f" || exit 1
done
config_hash=$(cat "$CONFIG" | md5_compat) || exit 1 config_hash=$(cat "$CONFIG" | md5_compat) || exit 1

4
odoo-tecnativa/hooks/init

@ -21,7 +21,9 @@ odoo_uid=$(get_odoo_uid)
mkdir -p "$LIB" mkdir -p "$LIB"
## XXXvlab: this one can fail if files are removed (from sessions dir) ## XXXvlab: this one can fail if files are removed (from sessions dir)
find "$LIB" \! -user "$odoo_uid" -exec chown -v "$odoo_uid" {} + || true
find "$LIB" \! -user "$odoo_uid" -print0 | while read-0 f; do
chown -v "$odoo_uid" "$f" || exit 1
done
## workers management ## workers management
workers=$(options-get workers 2>&1) || true workers=$(options-get workers 2>&1) || true

6
peertube/hooks/init

@ -80,8 +80,8 @@ for dir in "${dirs[@]}"; do
done done
mkdir -p "${host_dirs[@]}" mkdir -p "${host_dirs[@]}"
find "${host_dirs[@]}" \! -user "$peertube_uid" \
-exec chown -v "$peertube_uid" {} + || true
find "${host_dirs[@]}" \! -user "$peertube_uid" -print0 | while read-0 f; do
chown -v "$peertube_uid" "$f" || exit 1
done
true true

6
redis/hooks/init

@ -47,9 +47,9 @@ for dir in "${dirs[@]}"; do
done done
mkdir -p "${host_dirs[@]}" mkdir -p "${host_dirs[@]}"
find "${host_dirs[@]}" \! -user "$uid" \
-exec chown -v "$uid" {} + || true
find "${host_dirs[@]}" \! -user "$uid" -print0 | while read-0 f; do
chown -v "$uid" "$f" || exit 1
done
config_hash=$(cat "$CONFIG" | md5_compat) || exit 1 config_hash=$(cat "$CONFIG" | md5_compat) || exit 1
init-config-add " init-config-add "

6
rocketchat/hooks/init

@ -21,6 +21,6 @@ for dir in "${dirs[@]}"; do
done done
mkdir -p "${host_dirs[@]}" mkdir -p "${host_dirs[@]}"
find "${host_dirs[@]}" \! -user "$uid" \
-exec chown -v "$uid" {} + || true
find "${host_dirs[@]}" \! -user "$uid" -print0 | while read-0 f; do
chown -v "$uid" "$f" || exit 1
done

8
synapse/lib/common

@ -36,8 +36,12 @@ setup_dirs() {
gid="${uid_gid[1]}" gid="${uid_gid[1]}"
for dir in "${dirs[@]}"; do for dir in "${dirs[@]}"; do
mkdir -p "$dir" mkdir -p "$dir"
find "$dir" \! -uid "$uid" -exec chown -v "$uid" {} \;
find "$dir" \! -gid "$gid" -exec chgrp -v "$gid" {} \;
find "$dir" \! -uid "$uid" -print0 | while read-0 f; do
chown -v "$uid" "$f" || return 1
done
find "$dir" \! -gid "$gid" -print0 | while read-0 f; do
chgrp -v "$gid" "$f" || return 1
done
done done
dirs=( dirs=(

Loading…
Cancel
Save