mirror of
https://github.com/linuxserver/docker-code-server.git
synced 2024-11-22 20:15:41 +01:00
fix apply chown permissions in parallel for large workspace
This commit is contained in:
parent
d1ae5a93d7
commit
b54982550b
@ -76,6 +76,7 @@ app_setup_block: |
|
|||||||
# changelog
|
# changelog
|
||||||
changelogs:
|
changelogs:
|
||||||
- { date: "11.07.21:", desc: "Bump node to 14 to fix builds" }
|
- { date: "11.07.21:", desc: "Bump node to 14 to fix builds" }
|
||||||
|
- { date: "05.07.21:", desc: "Fix slow `chown` on large workspace" }
|
||||||
- { date: "08.05.21:", desc: "Fix doc link" }
|
- { date: "08.05.21:", desc: "Fix doc link" }
|
||||||
- { date: "04.02.20:", desc: "Allow setting gui password via hash using env var `HASHED_PASSWORD`." }
|
- { date: "04.02.20:", desc: "Allow setting gui password via hash using env var `HASHED_PASSWORD`." }
|
||||||
- { date: "23.12.20:", desc: "Allow setting sudo password via hash using env var `SUDO_PASSWORD_HASH`." }
|
- { date: "23.12.20:", desc: "Allow setting sudo password via hash using env var `SUDO_PASSWORD_HASH`." }
|
||||||
|
@ -18,5 +18,20 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# permissions
|
# permissions
|
||||||
|
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 \
|
chown -R abc:abc \
|
||||||
/config
|
/config
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user