Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find faster with fewer execs #3821

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# The GEM_PATH should work since we allow only one version of ruby to be installed.
GEM_PATH = "#{LIB_PATH}/ruby/gems/*/gems".freeze

execute "find #{GEM_PATH} -perm /u=x,g=x,o=x -exec chmod 755 {} \\;" do
execute "find #{GEM_PATH} -perm /u=x,g=x,o=x -exec chmod 755 {} \\+" do
user 'root'
end

execute "find #{GEM_PATH} -perm /u=r,g=r,o=r ! -perm /u=x -exec chmod 644 {} \\;" do
execute "find #{GEM_PATH} -perm /u=r,g=r,o=r ! -perm /u=x -exec chmod 644 {} \\+" do
user 'root'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"#{node['private_chef']['nginx']['dir']}",
"#{node['private_chef']['nginx']['log_directory']}",
].each do |nginx_no_root_perms_fix_path|
execute "find #{nginx_no_root_perms_fix_path} -user 'root' -exec chown #{node['private_chef']['user']['username']} {} \\;" do
execute "find #{nginx_no_root_perms_fix_path} -user 'root' -exec chown #{node['private_chef']['user']['username']} {} \\+" do
user 'root'
only_if do
node['private_chef']['nginx']['nginx_no_root'] &&
Expand Down
Loading