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

        rotate 4
                invoke-rc.d rsyslog rotate > /dev/null

to keep my iptables logs rotated.

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

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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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