Bug#734688: Logs are not rotated for a month

2016-12-29 Thread Christoph Biedl
Hello again everybody,

in order to get this issue finally resolved, I've contacted the
maintainer (Paul Martin) yesterday. Given the time of the year a reply
might take a few days. So for the moment: I've prepared a non-maintainer
upload for the new upstream version, please give it a try and report
back:

https://mentors.debian.net/debian/pool/main/l/logrotate/logrotate_3.11.0-0.1.dsc

Note about rebuilding: The test suite is rather picky about file system
specifics, using sbuild/overlay results in an error.

Cheers,
Christoph


signature.asc
Description: Digital signature


Bug#734688: Logs are not rotated for a month

2016-12-26 Thread Christoph Biedl
Mathieu Parent wrote...

> The actual upstream fix for it is:
> https://github.com/logrotate/logrotate/commit/fc1c3eff61edf8e9f0a4bfa980f3a6030a6b271f
> 
> And it is included in version 3.11.0.
> 
> The way forward is to update Debian package to 3.11.0.

ACK. This version handles my test cases in a robust way.

Christoph, consider this a Tested-by:


signature.asc
Description: Digital signature


Bug#734688: Logs are not rotated for a month

2016-12-26 Thread Mathieu Parent
Control: tag -1 + upstream fixed-upstream

Hello,

2016-12-26 1:29 GMT+01:00 Christoph Biedl :
> Hello everybody,
>
> looking at this old but nasty bug that must be fixed for stretch:
>
> * Trying to understand what goes wrong I wrote a small script that
>   creates a few scenarios and executes logrotate then. Run it in
>   an arbitrary directory like /tmp/ as regular user, with a single
>   parameter in the range 0 to 4. Expect a lot of failures.
>
> * In my understanding logrotate never compresses older logfiles even
>   if they are not compressed yet, this will lead to the observed
>   clashes. So I was about to write a patch that similar for Bolesław's
>   proposal detects if the target file already exists, but would
>   compress it then. However:
>
> * github[1] contains a link[2] to a patch gentoo created. At least
>   for all scenario my test script above creates, it solves the problems.
>   I'd suggest you all test it as well and report back.

The actual upstream fix for it is:
https://github.com/logrotate/logrotate/commit/fc1c3eff61edf8e9f0a4bfa980f3a6030a6b271f

And it is included in version 3.11.0.

The way forward is to update Debian package to 3.11.0.

Regards
-- 
Mathieu



Bug#734688: Logs are not rotated for a month

2016-12-25 Thread Christoph Biedl
Hello everybody,

looking at this old but nasty bug that must be fixed for stretch:

* Trying to understand what goes wrong I wrote a small script that
  creates a few scenarios and executes logrotate then. Run it in
  an arbitrary directory like /tmp/ as regular user, with a single
  parameter in the range 0 to 4. Expect a lot of failures.

* In my understanding logrotate never compresses older logfiles even
  if they are not compressed yet, this will lead to the observed
  clashes. So I was about to write a patch that similar for Bolesław's
  proposal detects if the target file already exists, but would
  compress it then. However:

* github[1] contains a link[2] to a patch gentoo created. At least
  for all scenario my test script above creates, it solves the problems.
  I'd suggest you all test it as well and report back.

Cheers,

Christoph

[1] https://github.com/logrotate/logrotate/pull/23
[2] 
https://gitweb.gentoo.org/repo/gentoo.git/plain/app-admin/logrotate/files/logrotate-3.10.0-atomic-create.patch?id=3aae9fbc
#!/bin/sh

set -e

mkdir -p logs
rm logs/* 2>/dev/null || true

create () {
touch logs/logfile
while [ "$1" ] ; do
echo "$1" >logs/logfile$1
shift
done
}

compress () {
while [ "$1" ] ; do
gzip logs/logfile$1
shift
done
}


case "$1" in
0)
# vanilla: some older logfiles
create  '.1' '.2' '.3'
compress'.1' '.2' '.3'
;;
1)
# first generation exists both plain and compressed
create  '.1' '.2' '.3'
compress'.1' '.2' '.3'
create  '.1'
;;
2)
# first generation is not compressed - ERROR
create  '.1' '.2' '.3' '.4'
compress '.2' '.3' '.4'
;;
3)
# gen.1 not compressed, gen.2 missing
create  '.1'  '.3' '.4'
compress  '.3' '.4'
;;
4)
# gen.1 not compressed, gen.[23] missing
create  '.1'   '.4'
compress   '.4'
;;
'')
echo "Usage: $0 "
exit 1
;;
*)
echo "BUG: Undefined scenario '$1'"
exit 2
;;
esac

CONF="$PWD/logrotate.conf"

cat <<__EOS__ >"$CONF"
$PWD/logs/logfile {
daily
missingok
rotate 3
compress
copytruncate
create 640 $(getent passwd $(id -u) | cut -d: -f1) $(getent group $(id -g) 
| cut -d: -f1)
}
__EOS__

STATE="$PWD/state"
rm "$STATE" >/dev/null || true

echo 'Files in logs/ [PRE]:'
ls -1 logs/

/usr/sbin/logrotate --force --state "$STATE" --verbose "$CONF" || true

echo 'Files in logs/ [POST]:'
ls -1 logs/
echo 'State file:'
cat "$STATE"


signature.asc
Description: Digital signature


Bug#734688: Logs are not rotated for a month

2016-12-07 Thread Jaimos Skriletz
Hello,

I recently had /var/log fill up and am another conformation this bug
is in jessie. I was able to recover the issue and now have plenty of
space in /var/log but after cron.daily run I found this in my mailbox:

/etc/cron.daily/logrotate:
error: error creating output file /var/log/cups/access_log.1.gz: File exists
error: error creating output file /var/log/cups/page_log.1.gz: File exists
error: error creating output file /var/log/exim4/mainlog.1.gz: File exists
error: error creating output file /var/log/syslog.1.gz: File exists
run-parts: /etc/cron.daily/logrotate exited with return code 1

Thanks for your time,

jaimos



Bug#734688: Logs are not rotated for a month

2016-05-09 Thread Tim Connors
On Wed, 16 Dec 2015, Michael Gebetsroither wrote:

> Package: logrotate
> Version: 3.8.7-1+b1
> Followup-For: Bug #734688
>
> Dear Maintainer,
>
> Seconded, the problem still persists in jessie.
> Logrotate was practically broken after /var/log got full a month ago.
>
> There where various .log.1.gz files, most of which where 0 bytes which
> stopped logrotate to act on those files completely.
>
> # grep 'error creating output file' logrotate_force_20151216.log
> error: error creating output file /var/log/dpkg.log.1.gz: File exists
> error: error creating output file /var/log/alternatives.log.1.gz: File exists
> error: error creating output file /var/log/nginx/error.log.1.gz: File exists
> error: error creating output file /var/log/nginx/access.log.1.gz: File exists
> error: error creating output file /var/log/php5-fpm.log.1.gz: File exists
> error: error creating output file /var/log/syslog.1.gz: File exists
> error: error creating output file /var/log/daemon.log.1.gz: File exists
> error: error creating output file /var/log/auth.log.1.gz: File exists
> error: error creating output file /var/log/messages.1.gz: File exists

And in my case, it wasn't a 0 byte file - there was syslog.1 and
syslog.1.gz, both largish.  It is possible gzip simply failed the first
time because I ran out of space.

2 observations:

1) logrotate didn't output any diagnostics, or exit non zero.
Consequently, I noticed nothing in my cron.daily email for a month.  I
only noticed when a usb failure meant the syslog file grew enormously, and
I saw the top of the messages were from a month prior.

2) All these suggestions of heuristics about deleting a file if 0 sized
and created immediately before etc.  Why not just, when logrotate finds a
base file whose .gz already exists, recursively call itself again to start
rotating down to the current file, which can then be compressed and resume
where we were?

Sorry no patches, already after my bedtime, and this has already been
languishing in my todo list for a couple of weeks.


-- 
Tim Connors



Bug#734688: Logs are not rotated for a month

2015-12-18 Thread Michael Gebetsroither
Package: logrotate
Version: 3.8.7-1+b1
Followup-For: Bug #734688

Dear Maintainer,

Seconded, the problem still persists in jessie.
Logrotate was practically broken after /var/log got full a month ago.

There where various .log.1.gz files, most of which where 0 bytes which
stopped logrotate to act on those files completely.

# grep 'error creating output file' logrotate_force_20151216.log
error: error creating output file /var/log/dpkg.log.1.gz: File exists
error: error creating output file /var/log/alternatives.log.1.gz: File exists
error: error creating output file /var/log/nginx/error.log.1.gz: File exists
error: error creating output file /var/log/nginx/access.log.1.gz: File exists
error: error creating output file /var/log/php5-fpm.log.1.gz: File exists
error: error creating output file /var/log/syslog.1.gz: File exists
error: error creating output file /var/log/daemon.log.1.gz: File exists
error: error creating output file /var/log/auth.log.1.gz: File exists
error: error creating output file /var/log/messages.1.gz: File exists

# ls -lah daemon.log*
-rw-r- 1 root adm 3.1G Dec 16 19:07 daemon.log
-rw-r- 1 root adm 600K Sep 28 06:17 daemon.log.1
-rw-r- 1 root adm0 Oct  4 06:25 daemon.log.1.gz
-rw-r- 1 root adm  43K Sep 20 06:03 daemon.log.2.gz
-rw-r- 1 root adm 111K Sep 13 05:55 daemon.log.3.gz
-rw-r- 1 root adm  480 Sep  6 22:45 daemon.log.4.gz

# log from logrotate -f -v for daemon.log
rotating log /var/log/daemon.log, log->rotateCount is 4
dateext suffix '-20151216'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
compressing log with: /bin/gzip
error: error creating output file /var/log/daemon.log.1.gz: File exists
log /var/log/daemon.log.5.gz doesn't exist -- won't try to dispose of it

michael

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

-- no debconf information



Bug#734688: Logs are not rotated for a month

2015-12-16 Thread Sebastian Niehaus
Package: logrotate
Version: 3.8.7-1+b1
Followup-For: Bug #734688

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dear Maintainer,

the problem still persists in jessie.  I suppose it started after running 
out of space on /var/ which caused do stop log file compression to fail. 
Logrotate does not recover from this situation if there is again more space
on /var/, I manuall removed *log.1.gz for those files with file size of zero

The directory listing attached is *after* the deletion of these files.

 
Thank you for all the good work :-)


Sebastian 

- -- Package-specific info:
Contents of /etc/logrotate.d
total 31
- -rw-r--r-- 1 root root 433 Mar 15  2015 apache2
- -rw-r--r-- 1 root root 173 Jan 25  2011 apt
- -rw-r--r-- 1 root root  79 Oct 16  2010 aptitude
- -rw-r--r-- 1 root root 125 Nov  4  2012 capi4hylafax
- -rw-r--r-- 1 root root 304 Apr 10  2015 chrony
- -rw-r--r-- 1 root root 393 May  2  2015 clamav-freshclam
- -rw-r--r-- 1 root root 135 Feb 25  2010 consolekit
- -rw-r--r-- 1 root root 181 Feb 16  2015 cups-daemon
- -rw-r--r-- 1 root root 132 Apr  4  2012 dirmngr
- -rw-r--r-- 1 root root 232 Jan 30  2011 dpkg
- -rw-r--r-- 1 root root 146 Jan 31  2011 exim4-base
- -rw-r--r-- 1 root root 126 Jan 31  2011 exim4-paniclog
- -rw-r--r-- 1 root root 313 Mar 19  2014 fail2ban
- -rw-r--r-- 1 root root 140 Dec 12  2014 firebird2.5
- -rw-r--r-- 1 root root 100 Jan 13  2011 kdm
- -rw-r--r-- 1 root root 124 Jan 12  2015 mediatomb
- -rw-r--r-- 1 root root 184 Oct 15  2014 minidlna
- -rw-r--r-- 1 root root 101 Feb  5  2013 mpd
- -rw-r--r-- 1 root root  74 Dec 26  2010 mrtg
- -rw-r--r-- 1 root root 847 Apr 18  2015 mysql-server
- -rw-r--r-- 1 root root 209 Sep 19  2013 mythlogserver
- -rw-r--r-- 1 root root 157 Nov 17  2010 pm-utils
- -rw-r--r-- 1 root root 248 May 24  2010 polipo
- -rw-r--r-- 1 root root  94 Aug  9  2010 ppp
- -rw-r--r-- 1 root root 515 Mar  5  2013 rsyslog
- -rw-r--r-- 1 root root 321 Mar  7  2015 samba
- -rw-r--r-- 1 root root 513 Feb  2  2011 speech-dispatcher
- -rw-r--r-- 1 root root 234 Apr  6  2015 tor
- -rw-r--r-- 1 root root 115 Jan 21  2013 unattended-upgrades


- -- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/3 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages logrotate depends on:
ii  anacron 2.3-23
ii  base-passwd 3.5.37
ii  cron [cron-daemon]  3.0pl1-127+deb8u1
ii  libacl1 2.2.52-2
ii  libc6   2.19-18+deb8u1
ii  libpopt01.16-10
ii  libselinux1 2.3-2

Versions of packages logrotate recommends:
ii  bsd-mailx [mailx]   8.1.2-0.20141216cvs-2
ii  heirloom-mailx [mailx]  12.5-4

logrotate suggests no packages.

- -- debconf-show failed

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlZxGWwACgkQqVj5VlP9Od0YYwCfc1QxyqlkqH2d2FBHhu1HG4nA
nhkAn2RAgQJRe5fTfxdRRbRMg9U7qLma
=3wum
-END PGP SIGNATURE-



Bug#734688: Logs are not rotated for a month

2015-02-25 Thread Zachary Harris
Regarding the patch proposed by Bolesław Tokarski
(logrotate-dest-file-exists(2).patch) , I would not want logrotate to
delete a zero-size log file that it happens to find on the system. An
empty log file could be telling you something very important!

However, if logrotate runs into an error which causes it to create a
superfluous empty file *itself*, then I would definitely support an
immediate rollback at that point by having logrotate eliminate the empty
file it just created.

My scenario for running into this bug is the following. Say the /var
partition gets nearly full. logrotate tries to compress x.1 but there
isn't sufficient space so it ends up with an empty x.1.gz, but x.1 is
still fully intact. Next time around, logrotate won't even try to
compress x.1 because it is already blocked by the empty x.1.gz that the
previous round of logrotate itself created.

So, towards the end of logrotate.c::compressLogFile() I would propose an
addition in accordance with the following comment:

  if (!WIFEXITED(status) || WEXITSTATUS(status)) {
/* if outFile is empty then delete it */
message(MESS_ERROR, failed to compress log %s\n, name);
return 1;
  }

And, of course, I would want to log the error message. :)

-Zach



Bug#734688: Logs are not rotated for a month

2014-11-12 Thread Андрей Семашев
 I'm having the same problem in Wheezy (logrotate version 3.8.1-4).



Bug#734688: Logs are not rotated for a month

2014-06-02 Thread Peter Pöschl
I am using cron + latest fcron 3.1.3-1 from http://debs.slavino.sk and get 
error mails from fcron:

/etc/cron.daily/logrotate:
logrotate_script: 2: logrotate_script: invoke-rc.d: not found
error: error running shared postrotate script for '/var/log/cups/*log '
logrotate_script: 2: logrotate_script: invoke-rc.d: not found
error: error running non-shared postrotate script for /var/log/syslog of 
'/var/log/syslog
'
run-parts: /etc/cron.daily/logrotate exited with return code 1
/etc/cron.daily/man-db:
/etc/cron.daily/man-db: 28: /etc/cron.daily/man-db: start-stop-daemon: not 
found
run-parts: /etc/cron.daily/man-db exited with return code 127
Job run-parts --report /etc/cron.daily terminated (exit status: 1) (mailing 
output)

The reason for this might be 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617898

If this hunch is correct, putting 
PATH = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
into /etc/fcrontab should help.


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



Bug#734688: Logs are not rotated for a month

2014-06-02 Thread martin f krafft
also sprach Peter Pöschl pp2ml.deb0...@nest-ai.de [2014-06-02 09:45 +0200]:
 If this hunch is correct, putting 
 PATH = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 into /etc/fcrontab should help.

This has nothing to do with the original problem. I found that the
only way to solve it was to use --force.

-- 
 .''`.   martin f. krafft madduck@d.o  Related projects:
: :'  :  proud Debian developer   http://debiansystem.info
`. `'`   http://people.debian.org/~madduckhttp://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
there are two major products that come out of berkeley: lsd and unix.
 one caused me an addiction
 -- fyodor


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Bug#734688: Logs are not rotated for a month - patch

2014-02-26 Thread Bolesław Tokarski

I have just bumped myself to the same issue. Your error message:


error: error creating output file /var/log/syslog.1.gz: File exists


indicates that the file syslog.1.gz exists. @madduck can you check that the 
file doesn't really exist?

In my case a previous logrotate command must have been interrupted while 
gzipping, creating:
syslog
syslog.1
syslog.1.gz
syslog.2.gz
etc
where syslog.1.gz was of 0 size. Apparently, the compression error causes this 
to not attempt rename and rotation.

I suggest adding some handling to logrotate so that it would check the 
destination file's existance.
In the patch attached I am modifying the 'createOutputFile' function to stat 
the destination file and either
remove it (if it's of size 0) or rename it to .garbage (otherwise).

I have given very little testing to this patch, please reviewtest it.

--- logrotate-3.8.7.orig/logrotate.c
+++ logrotate-3.8.7/logrotate.c
@@ -300,10 +300,34 @@ static int runScript(struct logInfo *log
 int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
 {
 int fd;
-   struct stat sb_create;
-   int acl_set = 0;
+struct stat sb_create;
+int acl_set = 0;

-   fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
+if (stat(fileName, sb_create) == 0) {
+   /* this indicates that the destination file exists, while it should not */
+   if (sb_create.st_size == 0) {
+ /* the file is of zero size, so not needed */
+ if (unlink(fileName) != 0) {
+   message(MESS_ERROR, output file %s exists and failed to remove it: %s\n,
+  fileName, strerror(errno));
+   return -1;
+ }
+   } else {
+ int fnlength=sizeof(fileName);
+ char* garbage=malloc(fnlength+8); /* 'garbage\0' */
+ strncpy(garbage, fileName, fnlength);
+ strncpy(garbage+fnlegth, garbage\0);
+ if (rename(filename,garbage) != 0) {
+   message(MESS_ERROR, output file %s exists and failed to rename it to %s: %s\n,
+  fileName, garbage, strerror(errno));
+   free(garbage);
+   return -1;
+   }
+   free(garbage);
+
+}
+
+fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
(S_IRUSR | S_IWUSR)  sb-st_mode);

 if (fd  0) {


Bug#734688: Logs are not rotated for a month - patch

2014-02-26 Thread Bolesław Tokarski
I did some basic testing and investigations and I am attaching a 
corrected patch.


I have found that the problem only started appearing in version 3.8.0. 
In versions prior to that, the security-388608.patch used an 
unlink(fileName) in the beginning of createOutputFile function call.


However, in debian/changelog it is mentioned that the security bug that 
this patch was related to was fixed upstream. I don't know how it was 
fixed, but the unlink was gone and the O_EXCL flag in the 
createOutputFile is set in fopen causing the call to fail when the 
destination file exists.



diff --git a/logrotate.c b/logrotate.c
index 174a26b..1306b1f 100644
--- a/logrotate.c
+++ b/logrotate.c
@@ -300,10 +300,35 @@ static int runScript(struct logInfo *log, char *logfn, char *script)
 int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
 {
 int fd;
-   struct stat sb_create;
-   int acl_set = 0;
+struct stat sb_create;
+int acl_set = 0;
+
+if (stat(fileName, sb_create) == 0) {
+   /* this indicates that the destination file exists, while it should not */
+   if (sb_create.st_size == 0) {
+ /* the file is of zero size, so not needed */
+ if (unlink(fileName) != 0) {
+   message(MESS_ERROR, output file %s exists and failed to remove it: %s\n,
+  fileName, strerror(errno));
+   return -1;
+ }
+   } else {
+ int fnlength=sizeof(fileName);
+ char* garbage=malloc(fnlength+8); /* 'garbage\0' */
+ strncpy(garbage, fileName, fnlength);
+ strncpy(garbage+fnlength, garbage\0, 8);
+ if (rename(fileName,garbage) != 0) {
+   message(MESS_ERROR, output file %s exists and failed to rename it to %s: %s\n,
+  fileName, garbage, strerror(errno));
+   free(garbage);
+   return -1;
+   }
+   free(garbage);
+
+  }
+}
 
-   fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
+fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
(S_IRUSR | S_IWUSR)  sb-st_mode);
 
 if (fd  0) {


Bug#734688: Logs are not rotated for a month

2014-01-11 Thread Paul Martin
On Thu, Jan 09, 2014 at 02:31:16PM +0800, martin f krafft wrote:
 I just happened to notice that /var/log/syslog had not been rotated
 in almost 1 month:
 
   % ls -l /var/log/syslog*
   -rw-r- 1 root adm 16588618 Jan  9 14:21 /var/log/syslog
   -rw-r- 1 root adm   336215 Dec 11 15:37 /var/log/syslog.1
 
 Indeed, when I run logrotate, nothing happens:
 
   % sudo logrotate -d /etc/logrotate.d/rsyslog 21 | grep -A2 syslog
   reading config file /etc/logrotate.d/rsyslog
 
   Handling 2 logs
 
 Here is the status file, indicating that something's wrong:
 
   % grep syslog /var/lib/logrotate/status
   /var/log/syslog 2014-1-9-10:41:57
 
 And indeed, logrotate *thinks* it's rotating, but it actually does not:
 
   % sudo logrotate --force -d /etc/logrotate.d/rsyslog

What's in /etc/logrotate.d/rsyslog and /etc/logrotate.conf?

Running with -d (--debug) doesn't change anything. If you want to
watch a forced rotation, use -v (--verbose).

I'm also using rsyslog, the same version of logrotate, and rotation is
happening correctly.

Have you checked root's mailbox to see if logrotate is crashing before
reaching rsyslog? (It shouldn't be, as it's updated the status file,
but you never know.)

-- 
Paul Martin p...@debian.org


signature.asc
Description: Digital signature


Bug#734688: Logs are not rotated for a month

2014-01-11 Thread martin f krafft
also sprach Paul Martin p...@debian.org [2014-01-11 23:58 +1300]:
 What's in /etc/logrotate.d/rsyslog and /etc/logrotate.conf?

They are unmodified from the package.

 Running with -d (--debug) doesn't change anything. If you want to
 watch a forced rotation, use -v (--verbose).

Weird, but okay. This reveals:

  rotating pattern: /var/log/syslog
  forced from command line (7 rotations)
  empty log files are not rotated, old logs are removed
  considering log /var/log/syslog
log needs rotating
  rotating log /var/log/syslog, log-rotateCount is 7
  dateext suffix '-20140112'
  glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
  compressing log with: /bin/gzip
  error: error creating output file /var/log/syslog.1.gz: File exists
  log /var/log/syslog.8.gz doesn't exist -- won't try to dispose of it

(and analogous for all the other logfiles managed by logrotate)

 Have you checked root's mailbox to see if logrotate is crashing
 before reaching rsyslog? (It shouldn't be, as it's updated the
 status file, but you never know.)

There are no mails to root.

-- 
 .''`.   martin f. krafft madduck@d.o  Related projects:
: :'  :  proud Debian developer   http://debiansystem.info
`. `'`   http://people.debian.org/~madduckhttp://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
they redundantly repeated themselves over and over,
 incessantly without end and ad infinitum
 -- ibid


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Bug#734688: Logs are not rotated for a month

2014-01-08 Thread martin f krafft
Package: logrotate
Version: 3.8.6-1
Severity: important

I just happened to notice that /var/log/syslog had not been rotated
in almost 1 month:

  % ls -l /var/log/syslog*
  -rw-r- 1 root adm 16588618 Jan  9 14:21 /var/log/syslog
  -rw-r- 1 root adm   336215 Dec 11 15:37 /var/log/syslog.1

Indeed, when I run logrotate, nothing happens:

  % sudo logrotate -d /etc/logrotate.d/rsyslog 21 | grep -A2 syslog
  reading config file /etc/logrotate.d/rsyslog

  Handling 2 logs
  --
  rotating pattern: /var/log/syslog
  after 1 days (7 rotations)
  empty log files are not rotated, old logs are removed
  considering log /var/log/syslog
log does not need rotating

Here is the status file, indicating that something's wrong:

  % grep syslog /var/lib/logrotate/status
  /var/log/syslog 2014-1-9-10:41:57

And indeed, logrotate *thinks* it's rotating, but it actually does not:

  % sudo logrotate --force -d /etc/logrotate.d/rsyslog
  reading config file /etc/logrotate.d/rsyslog

  Handling 2 logs

  rotating pattern: /var/log/syslog
  forced from command line (7 rotations)
  empty log files are not rotated, old logs are removed
  considering log /var/log/syslog
log needs rotating
  rotating log /var/log/syslog, log-rotateCount is 7
  dateext suffix '-20140109'
  glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
  compressing log with: /bin/gzip
  renaming /var/log/syslog.7.gz to /var/log/syslog.8.gz (rotatecount 7, 
logstart 1, i 7), 
  renaming /var/log/syslog.6.gz to /var/log/syslog.7.gz (rotatecount 7, 
logstart 1, i 6), 
  renaming /var/log/syslog.5.gz to /var/log/syslog.6.gz (rotatecount 7, 
logstart 1, i 5), 
  renaming /var/log/syslog.4.gz to /var/log/syslog.5.gz (rotatecount 7, 
logstart 1, i 4), 
  renaming /var/log/syslog.3.gz to /var/log/syslog.4.gz (rotatecount 7, 
logstart 1, i 3), 
  renaming /var/log/syslog.2.gz to /var/log/syslog.3.gz (rotatecount 7, 
logstart 1, i 2), 
  renaming /var/log/syslog.1.gz to /var/log/syslog.2.gz (rotatecount 7, 
logstart 1, i 1), 
  renaming /var/log/syslog.0.gz to /var/log/syslog.1.gz (rotatecount 7, 
logstart 1, i 0), 
  renaming /var/log/syslog to /var/log/syslog.1
  running postrotate script
  running script with arg /var/log/syslog: 
  invoke-rc.d rsyslog rotate  /dev/null
  
  removing old log /var/log/syslog.8.gz
  error: error opening /var/log/syslog.8.gz: No such file or directory

Nothing has actually changed.

-- Package-specific info:
Contents of /etc/logrotate.d
total 100
-rw-r--r-- 1 root root 434 Jun  8  2013 apache2
-rw-r--r-- 1 root root 173 Aug 25  2010 apt
-rw-r--r-- 1 root root  79 Mar 13  2010 aptitude
-rw-r--r-- 1 root root  69 Jun 18  2011 backupninja
-rw-r--r-- 1 root root 279 Jun 15  2012 bmc-watchdog
-rw-r--r-- 1 root root 135 May 20  2011 consolekit
-rw-r--r-- 1 root root 430 Jun  4  2013 cups-daemon
-rw-r--r-- 1 root root 112 Oct 12 23:04 cupt
-rw-r--r-- 1 root root 232 Jul 31  2010 dpkg
-rw-r--r-- 1 root root  94 Dec 20  2009 hibernate
-rw-r--r-- 1 root root 151 Sep 13  2009 iptraf
-rw-r--r-- 1 root root 135 Oct  5  2012 iptraf-ng
-rw-r--r-- 1 root root 165 Jul 24  2011 libvirtd
-rw-r--r-- 1 root root 162 Jul 24  2011 libvirtd.lxc
-rw-r--r-- 1 root root 163 Jul 24  2011 libvirtd.qemu
-rw-r--r-- 1 root root 162 Jul 24  2011 libvirtd.uml
-rw-r--r-- 1 root root 157 Mar 19  2010 pm-utils
-rw-r--r-- 1 root root 234 May 16  2013 polipo
-rw-r--r-- 1 root root 173 Dec  6  2011 postgresql-common
-rw-r--r-- 1 root root  94 Dec  1  2008 ppp
-rw-r--r-- 1 root root 515 May 31  2011 rsyslog
-rw-r--r-- 1 root root 117 Aug 18 02:48 salt-common
-rw-r--r-- 1 root root 298 Apr 20  2011 stunnel4
-rw-r--r-- 1 root root 190 Apr 13  2011 tor
-rw-r--r-- 1 root root 276 Mar 14  2010 xdm


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_NZ, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages logrotate depends on:
ii  anacron 2.3-20
ii  base-passwd 3.5.29
ii  cron [cron-daemon]  3.0pl1-124
ii  libacl1 2.2.52-1
ii  libc6   2.17-97
ii  libpopt01.16-8
ii  libselinux1 2.2.1-1

Versions of packages logrotate recommends:
ii  heirloom-mailx [mailx]  12.5-2

logrotate suggests no packages.

-- no debconf information


-- 
 .''`.   martin f. krafft madduck@d.o  Related projects:
: :'  :  proud Debian developer   http://debiansystem.info
`. `'`   http://people.debian.org/~madduckhttp://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)