How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

March 31, 2008

Fix syslog with FC2

Filed under: Linux — Tags: , , — admin @ 2:20 pm

If you have Fedora Core 2, and recive mail from logrotate with

etc/cron.daily/logrotate:

error: error running postrotate script


error: error running postrotate script
error: 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

then you may want try this fix.

mkdir /mytmp
then edit pico -w /etc/cron.daily/logrotate and set the TMPDIR so it looks like this:

#!/bin/sh
TMPDIR=/mytmp
export TMPDIR
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate “ALERT exited abnormally with [$EXITVALUE]”
fi
exit 0

Then run : /etc/init.d/syslog restart
And run /etc/cron.daily/logrotate and see if it works.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress