From ea0f1f933783d6a781d028f9135fab9a46277a2e Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 2 May 2016 11:14:53 +0800 Subject: [PATCH] new: [apache/log-rotate] can configure the rotation count from ``compose.yml``. --- apache/hooks/log_rotate-relation-joined | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apache/hooks/log_rotate-relation-joined b/apache/hooks/log_rotate-relation-joined index 7481de07..56d9ef35 100755 --- a/apache/hooks/log_rotate-relation-joined +++ b/apache/hooks/log_rotate-relation-joined @@ -14,6 +14,9 @@ LOGS=/var/log/apache2 # return 1 # } +rotated_count=$(relation-get rotated-count 2>/dev/null) || true +rotated_count=${rotated_count:-52} + ## XXXvlab: a lot of this intelligence should be moved away into ``logrotate`` charm DST="$CONFIGSTORE/$TARGET_SERVICE_NAME/etc/logrotate.d/$SERVICE_NAME" file_put "$DST" <