From 25a7de18bd6897d6dbff7d8a8ef9f2096e702510 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 28 Aug 2014 10:51:22 +1000 Subject: [PATCH] FIX: logrotation for containers that constantly rebuild --- templates/web.template.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/web.template.yml b/templates/web.template.yml index eeae3bc..4521bfe 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -169,3 +169,14 @@ run: sv 1 unicorn endscript } + # move state out of the container this fancy is done to support rapid rebuilds of containers, + # we store anacron and logrotate state outside the container to ensure its maintained across builds + # later move this snipped into an intialization script + - exec: + cmd: + - rm -fr /var/lib/logrotate + - mkdir -p /shared/state/logrotate + - ln -s /shared/state/logrotate /var/lib/logrotate + - rm -fr /var/spool/anacron + - mkdir -p /shared/state/anacron-spool + - ln -s /shared/state/anacron-spool /var/spool/anacron -- 2.25.1