[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#115989: general: log rotate script for apache does not work properly when Including Directories



Package: general
Version: 20011017
Severity: normal

in /etc/cron.daily/apache

    CONFS=$(awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' \
        /etc/apache/*.conf | sort -u)
    LOGS=$(awk '$1 ~ /^\s*[A-Za-z]*Log$/ && $2 ~ /^\// {print $2}' \
        /etc/apache/*.conf $CONFS | sort -u)

If in /etc/apache/conf/httpd.conf you include Directories as such:

Include /etc/local-config/apache/ 

but when the two lines above are run, the following results:

++ awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' /etc/apache/access.conf /etc/apache/cron.conf /etc/apache/httpd.conf /etc/apache/srm.conf
++ sort -u
+ CONFS=/etc/local-config/apache/
++ awk '$1 ~ /^\s*[A-Za-z]*Log$/ && $2 ~ /^\// {print $2}' /etc/apache/access.conf /etc/apache/cron.conf /etc/apache/httpd.conf /etc/apache/srm.conf /etc/local-config/apache/
awk: read error (Is a directory)
++ sort -u
+ LOGS=/var/log/apache/access.log
/var/log/apache/error.log


awk: read error (Is a directory) <--

As such, any virtual host definitions in the /etc/local-config/apache/ directory are passed over and not rotated.


-- System Information
Debian Release: testing/unstable
Kernel Version: Linux di1 2.4.9-colo #1 Fri Aug 17 12:58:41 CEST 2001 i686 unknown




Reply to: