]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/rsyncd/recipes/default.rb
rsync: increase rsyncd transfer speed
[chef.git] / cookbooks / rsyncd / recipes / default.rb
index 8ab06a0e79656edab9eb2434c863fa3f3fb40ce4..a2edd32faf14262009b2448f4136000adc670036 100644 (file)
@@ -1,8 +1,8 @@
 #
-# Cookbook Name:: rsyncd
+# Cookbook:: rsyncd
 # Recipe:: default
 #
-# Copyright 2011, OpenStreetMap Foundation
+# Copyright:: 2011, OpenStreetMap Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -42,6 +42,13 @@ end
 
 package "rsync"
 
+systemd_service "rsync-override" do
+  service "rsync"
+  dropin "override"
+  exec_start "/usr/bin/rsync --daemon --no-detach --bwlimit=16384"
+  notifies :restart, "service[rsync]"
+end
+
 service "rsync" do
   action [:enable, :start]
   supports :status => true, :restart => true
@@ -51,7 +58,7 @@ template "/etc/default/rsync" do
   source "rsync.erb"
   owner "root"
   group "root"
-  mode 0o644
+  mode "644"
   notifies :restart, "service[rsync]"
 end
 
@@ -59,7 +66,7 @@ template "/etc/rsyncd.conf" do
   source "rsyncd.conf.erb"
   owner "root"
   group "root"
-  mode 0o644
+  mode "644"
   variables :hosts_allow => hosts_allow, :hosts_deny => hosts_deny
 end