Skip to content

Commit

Permalink
feat: [NODE-1499] Run chown/chmod in setup-permissions in parallel (#…
Browse files Browse the repository at this point in the history
…3373)

This further increases the speed of the [reboot
toy](https://github.com/dfinity/ic/blob/36e2b45d4712908b8ddca1c05b50b8fc1d6562d1/rs/tests/node/BUILD.bazel#L31)
from 56.578s to 33.395s.
  • Loading branch information
Bownairo authored Jan 9, 2025
1 parent 36e2b45 commit aa705aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ic-os/components/ic/setup-permissions/erestorecon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
# erestorecon (easy prestorecon) uses UNIX tools to parallelize restorecon,
# instead of the cpp based prestorecon.

find $@ -print0 | xargs -0 -P 0 restorecon
find $@ -print0 | xargs -0 -P 0 restorecon -F
4 changes: 2 additions & 2 deletions ic-os/components/ic/setup-permissions/setup-permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function make_group_owned_and_sticky() {
local GROUP="$3"

mkdir -p "${TARGET_DIR}"
chown -R "${USER}:${GROUP}" "${TARGET_DIR}"
chmod u=rwX,g=rX,o= -R "${TARGET_DIR}"
find "${TARGET_DIR}" -print0 | xargs -0 -P 0 chown "${USER}:${GROUP}"
find "${TARGET_DIR}" -print0 | xargs -0 -P 0 chmod u=rwX,g=rX,o=
find "${TARGET_DIR}" -type d | xargs chmod g+s
}

Expand Down

0 comments on commit aa705aa

Please sign in to comment.