Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use a script /etc/logrotate.d/iptables containing entries like:

/var/log/in_iptables.log
{
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
                invoke-rc.d rsyslog rotate > /dev/null
        endscript
}

to keep my iptables logs rotated.

It seems to have been doing its job, but today I got a message from anacron:

/etc/cron.daily/logrotate:
The script you are attempting to invoke has been converted to an Upstart
job, but rotate is not supported for Upstart jobs.
invoke-rc.d: initscript rsyslog, action "rotate" failed.
error: error running shared postrotate script for '/var/log/in_iptables.log
run-parts: /etc/cron.daily/logrotate exited with return code 1

Can anyone explain to me what this means exactly? Do I need to be worried or change anything in order for my logs to keep rotating?

share|improve this question
add comment

1 Answer 1

I think it must be because rsyslog has been converted to an Upstart service now, so can't use the old invoke-rc.d command. Given this postrotate command execution is simply to reload the config of rsyslog so it stops writing to the old logfile (which has now been compressed), I think the new upstart way of doing this would be:

service rsyslog reload > /dev/null

Although I wonder if there is a way to make a "rotate" action work (not sure what benefit a rotate action would provide vs a simple reload anyway?)

As I understand it "rotate" is a custom action provided by logrotate.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.