verdon

Well-Known Member
Nov 1, 2003
923
11
168
Northern Ontario, Canada
cPanel Access Level
Root Administrator
For the last few weeks, I have been getting postrotate errors with my weekly logrotate

Code:
/etc/cron.daily/logrotate:

error running postrotate script
error running postrotate script
error running postrotate script
error running shared postrotate script for /etc/httpd/logs/*log 
error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log
I have read a number of threads here in regards to this issue, and at some point in the past (I don't really remember, but mod date would suggest about a year ago) I had already modified my /etc/cron.daily/logrotate to allow for the known noexec /tmp issue, as such

Code:
#!/bin/sh

if [ ! -e "/logrotate_tmp" ]; then
	mkdir /logrotate_tmp
fi
export TMPDIR=/tmp_logrotate

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
This hasn't been a problem until recently, and it seems like some things stop logging when it happens and I have to restart the services to get them logging again.

This of course happens early Sunday morning, and as soon as I see the error in the mail, I manually try running...

/usr/sbin/logrotate -vf /etc/logrotate.conf

...and...

export TMPDIR=/logrotate_tmp
/usr/sbin/logrotate -vf /etc/logrotate.conf

...but neither produces any errors that I can see.

Is there some way I can get a verbose output e-mailed to me when logrotate runs by cron? Maybe that will help me track this down.

Thanks,