#!/bin/bash ## Should be executable N time in a row with same result. . lib/common set -e uid_gid=$(docker_get_uid_gid "$MASTER_BASE_SERVICE_NAME" "odoo" "odoo") uid=${uid_gid%%$'\n'*} gid=${uid_gid#*$'\n'} LOGS=/var/log/odoo mkdir -p "$SERVICE_DATASTORE/$LOGS" chown -R "$odoo_uid" "$SERVICE_DATASTORE/$LOGS" rotated_count=$(relation-get rotated-count 2>/dev/null) || true rotated_count=${rotated_count:-52} ## No postrotate script as odoo uses a WatchedFileHandler log that ## close and reopen log file if it changes. ## 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" <