--- /dev/null
+#include <dlfcn.h>
+#include <unistd.h>
+
+static int (*real_close)(int fd);
+
+static void __attribute__((constructor)) initialise(void)
+{
+ real_close = dlsym(RTLD_NEXT, "close");
+}
+
+int close(int fd)
+{
+ fdatasync(fd);
+
+ return real_close(fd);
+}
package "libpq-dev"
gem_package "pg"
+package "make"
+package "gcc"
+
+remote_directory "/opt/flush" do
+ source "flush"
+ owner "root"
+ group "root"
+ mode 0o755
+ files_owner "root"
+ files_group "root"
+ files_mode 0o755
+end
+
+execute "/opt/flush/Makefile" do
+ action :nothing
+ command "make"
+ cwd "/opt/flush"
+ user "root"
+ group "root"
+ subscribes :run, "remote_directory[/opt/flush]"
+end
+
remote_directory "/usr/local/bin" do
source "replication-bin"
owner "root"
TZ=UTC
+MAILTO=zerebubuth@gmail.com
+
+0 7 * * * planet /usr/local/bin/users-agreed
+* * * * * planet /usr/local/bin/replicate-changesets /etc/replication/changesets.conf
+
MAILTO=brett@bretth.com
+LD_PRELOAD=/opt/flush/flush.so
* * * * * planet /usr/local/bin/osmosis -q --replicate-apidb authFile=/etc/replication/auth.conf validateSchemaVersion=false --write-replication workingDirectory=/store/planet/replication/minute
2 * * * * planet /home/bretth/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/hour
5 * * * * planet /home/bretth/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/day
-
-MAILTO=zerebubuth@gmail.com
-
-0 7 * * * planet /usr/local/bin/users-agreed
-* * * * * planet /usr/local/bin/replicate-changesets /etc/replication/changesets.conf