Public bug reported:

Binary package hint: logrotate

The cronjob /etc/cron.daily/logrotate looks like this:

#!/bin/sh

# Clean non existent log file entries from status file
cd /var/lib/logrotate
head -1 status > status.clean
sed 's/"//g' status | while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean
mv status.clean status

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf


As you can see it expects the file /var/lib/logrotate/status to be
present. If it's not the cronjob throws an error-message:

/etc/cron.daily/logrotate:
head: cannot open `status' for reading: No such file or directory
sed: can't read status: No such file or directory

But this file is just present AFTER logrotate has been run at least
once. This means this cronjob always throws an error the first time
logrotate is run.

I wrote a little patch for the cronjob to fix this problem.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: logrotate 3.7.8-6ubuntu3
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
Architecture: amd64
Date: Fri May 20 11:49:03 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110426)
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: logrotate
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: logrotate (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug natty running-unity

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/785670

Title:
  logrotate cronjob /etc/cron.daily/logrotate throws errors when it is
  executed for the first time because it expects status file

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to