mirror of
https://github.com/linuxserver/docker-code-server
synced 2025-06-26 18:27:40 +00:00
fix apply chown permissions in parallel for large workspace
This commit is contained in:
@@ -18,5 +18,20 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
|
||||
fi
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/config
|
||||
if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then
|
||||
# Split workload between config and workspace
|
||||
echo "setting permissions::configuration"
|
||||
CORES=$(nproc --all)
|
||||
find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d | \
|
||||
xargs --max-args=1 --max-procs=$(($CORES*2*8)) \
|
||||
chown -R abc:abc
|
||||
|
||||
echo "setting permissions::workspace"
|
||||
chown abc:abc /config/workspace
|
||||
find /config/workspace -maxdepth 4 -mindepth 1 -type d | \
|
||||
xargs --max-args=1 --max-procs=$(($CORES*2*16)) \
|
||||
chown -R abc:abc
|
||||
else
|
||||
chown -R abc:abc \
|
||||
/config
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user