#!/bin/bash ## Should be executable N time in a row with same result. . lib/common set -e LOGS=/var/log/apache2 ## XXXvlab: hum it seems apache logging is run as root, so well... # logs_creds=$(cached_cmd_on_base_image apache "stat -c '%u %g' '$LOGS'") || { # debug "Failed to query for www-data gid in ${DARKYELLOW}apache${NORMAL} base image." # 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" <