From: Tom Hughes Date: Mon, 4 Jul 2022 19:25:56 +0000 (+0100) Subject: Make sure rsyncd can write to paths it needs to X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4901122db6d2b8b208d6659e6642593f4d2cb429?hp=c7997c40ec75327df2fd9624908312d18850b854 Make sure rsyncd can write to paths it needs to --- diff --git a/cookbooks/rsyncd/recipes/default.rb b/cookbooks/rsyncd/recipes/default.rb index a2edd32fa..0946a0c19 100644 --- a/cookbooks/rsyncd/recipes/default.rb +++ b/cookbooks/rsyncd/recipes/default.rb @@ -19,10 +19,13 @@ include_recipe "networking" +writable_paths = [] hosts_allow = {} hosts_deny = {} node[:rsyncd][:modules].each do |name, details| + writable_paths << details[:path] if details[:write_only] + hosts_allow[name] = details[:hosts_allow] || [] if details[:nodes_allow] @@ -46,6 +49,7 @@ systemd_service "rsync-override" do service "rsync" dropin "override" exec_start "/usr/bin/rsync --daemon --no-detach --bwlimit=16384" + read_write_paths writable_paths.sort notifies :restart, "service[rsync]" end