Package: logrotate
Version: 3.7.8-6
Severity: normal

In our system, each user may have a developer area within their homedir called 
"sites"
(eg "/home/daniel/sites"), as well as a shared directory used for hosting 
("/home/apache/sites").
One of our users instead decided to make /home/user1/sites a symlink to the 
shared area.
That means that logrotate does rotate the logs once for the real directory, and 
once for
the symlink. On the second pass, it will replace the .1 file with the newly 
created
file which is usually empty, which means that the rotated logs are all empty.

The logrotate.d file looks like this:
  /home/web/sites/*/*.log {
    compress
    daily
    copytruncate
    delaycompress
    rotate 14
    missingok
    sharedscripts
    notifempty
    postrotate
      /etc/init.d/apache2 reload > /dev/null
    endscript
  }


The end results is logs like this:
  -rw-rw-r-- 1 www-data   www-data    98447 Feb 10 15:21 ws.log
  -rw-rw-r-- 1 www-data   www-data        0 Feb 10 09:56 ws.log.1
  -rw-rw-r-- 1 www-data   www-data       20 Feb  6 06:36 ws.log.10.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb  5 06:26 ws.log.12.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb  4 06:54 ws.log.14.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb 10 06:51 ws.log.2.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb  9 06:28 ws.log.4.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb  8 06:41 ws.log.6.gz
  -rw-rw-r-- 1 www-data   www-data       20 Feb  7 06:51 ws.log.8.gz

It also seems to skip over every even logfile number except for ".1"

May I suggest using "stat" on the result from glob, to obtain the real path
of the file, and use that when rotating and in the database? I think that
should solve many of the link related issue here.

For now we have solved this by removing the symlink, but maybe others
runs into the same problem. Marking this bug as "normal", since I would
consider this a rare issue.

Let me know if you need any more info

- Daniel


-- Package-specific info:
Contents of /etc/logrotate.d
total 40
-rw-r--r-- 1 root root 194 Mar  3  2013 apache2
-rw-r--r-- 1 root root 173 Apr 15  2011 apt
-rw-r--r-- 1 root root  79 Aug 11  2011 aptitude
-rw-r--r-- 1 root root 232 Sep 17  2012 dpkg
-rw-r--r-- 1 root root 186 Feb 10 15:29 sites-log
-rw-r--r-- 1 root root 515 Nov 30  2010 rsyslog
-rw-r--r-- 1 root root 515 Nov 30  2010 rsyslog


-- System Information:
Debian Release: 6.0.8
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages logrotate depends on:
ii  base-passwd                   3.5.22     Debian base system master password
ii  cron                          3.0pl1-116 process scheduling daemon
ii  libc6                         2.11.3-4   Embedded GNU C Library: Shared lib
ii  libpopt0                      1.16-1     lib for parsing cmdline parameters
ii  libselinux1                   2.0.96-1   SELinux runtime shared libraries

Versions of packages logrotate recommends:
ii  bsd-mailx [mailx]  8.1.2-0.20100314cvs-1 simple mail user agent

logrotate suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to