From 90ebbf5d06f3e343aba13a8c6cde8b7b90b81008 Mon Sep 17 00:00:00 2001 From: Axel ROGER Date: Wed, 5 Dec 2012 14:32:31 +0000 Subject: [PATCH] A proper way to modify /etc/logrotate.d/roundcube-core --- .gitattributes | 1 + roundcube/roundcube-install | 20 +++++++++++++++++++ .../templates/logrotate.d/roundcube-core | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 roundcube/templates/logrotate.d/roundcube-core diff --git a/.gitattributes b/.gitattributes index 28587d6b..6db0b974 100644 --- a/.gitattributes +++ b/.gitattributes @@ -564,6 +564,7 @@ roundcube/class/m_roundcube.php -text roundcube/roundcube-install -text roundcube/roundcube_alternc_logo.png -text roundcube/templates/apache2/roundcube.conf -text +roundcube/templates/logrotate.d/roundcube-core -text roundcube/templates/roundcube/main.inc.php -text roundcube/templates/roundcube/plugins/managesieve/config.inc.php -text roundcube/templates/roundcube/plugins/password/config.inc.php -text diff --git a/roundcube/roundcube-install b/roundcube/roundcube-install index 95942c0f..3ef959e8 100644 --- a/roundcube/roundcube-install +++ b/roundcube/roundcube-install @@ -40,6 +40,7 @@ then # Configuration template location TEMPLATE_DIR="/etc/alternc/templates" CONFIG_FILES="etc/roundcube/main.inc.php etc/roundcube/plugins/password/config.inc.php" + LOGROTATE_FILES="etc/logrotate.d/roundcube-core" cat > $SED_SCRIPT <> /$file fi done + rm -f $SED_SCRIPT echo " Done" + for file in $LOGROTATE_FILES; do + TEMPLATE="$TEMPLATE_DIR/${file##etc/}" + echo -n " $file" + if [ -f "$TEMPLATE" ]; then + ( + echo '#######################################################' + echo '# /!\ DO NOT EDIT THIS FILE /!\ #' + echo '# Edit the one in /etc/alternc/templates/logrotate.d/ #' + echo '# and launch alternc.install again. #' + echo '#######################################################' + echo '' + ) > /$file + cat $TEMPLATE >> /$file + fi + done + + echo " Done" + . /usr/lib/alternc/functions.sh echo "giving write access to roundcube to the email password ..." diff --git a/roundcube/templates/logrotate.d/roundcube-core b/roundcube/templates/logrotate.d/roundcube-core new file mode 100644 index 00000000..3c6012f4 --- /dev/null +++ b/roundcube/templates/logrotate.d/roundcube-core @@ -0,0 +1,8 @@ +/var/log/roundcube/password /var/log/roundcube/errors /var/log/roundcube/sendmail /var/log/roundcube/userlogins { + create 0640 alternc-roundcube root + compress + missingok + notifempty + rotate 52 + weekly +}