0

I see only two files maillog and maillog.1 in /var/log.

grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.

syslog

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron {
        daily
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

syslog-ng

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern {
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

and maillog.

/var/log/maillog  {
    daily
    compress
#    rotate 365
    rotate 14 
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.

2
  • Can you also post your default logrotate configuration /etc/logrotate.conf?
    – panaroik
    Sep 20, 2012 at 9:55
  • @panaroik Please find the defaults here sprunge.us/CQFF Sep 20, 2012 at 10:21

1 Answer 1

0
  • The first one is created by default.
  • The second one is created when installing syslog-ng.
  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?

ps -ef | grep syslog

UPDATE

Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:

postrotate
    /bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript

then run in debug mode (no changes will be made to the logs) to see what happens:

logrotate -d -f /etc/logrotate.d/syslog-ng
4
  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog. Sep 20, 2012 at 9:48
  • ls -l /var/log/maillog.1?
    – quanta
    Sep 20, 2012 at 14:36
  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists. Sep 21, 2012 at 5:18
  • Which part did you remove? updated my answer.
    – quanta
    Sep 21, 2012 at 6:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .