Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

Your Answer


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.