Skip to content

Commit 2ef2329

Browse files
committed
fix chown
1 parent d76a6d5 commit 2ef2329

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

root/etc/cont-init.d/30-config

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ fi
1919

2020
# permissions
2121
if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then
22+
CORES=$(nproc --all)
23+
2224
# Split workload between config and workspace
2325
echo "setting permissions::configuration"
24-
CORES=$(nproc --all)
25-
find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d -print0 | \
26-
xargs -r --max-args=1 --max-procs=$((CORES*2*8)) \
26+
find /config -path /config/workspace -prune -false -o -type d -print0 | \
27+
xargs --null -r --max-args=1 --max-procs=$((CORES*2*8)) \
2728
chown -R abc:abc
2829

2930
echo "setting permissions::workspace"
3031
chown abc:abc /config/workspace
31-
find /config/workspace -maxdepth 4 -mindepth 1 -type d -print0 | \
32-
xargs -r --max-args=1 --max-procs=$((CORES*2*16)) \
33-
chown -R abc:abc
3432
else
35-
chown -R abc:abc \
36-
/config
33+
# Set permissions on data mount
34+
# do not decend into the workspace
35+
chown -R abc:abc "$(ls /config -I workspace)"
36+
chown abc:abc /config/workspace
3737
fi

0 commit comments

Comments
 (0)