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.

In lots of online posts regarding how to rotate your iptables log files, for example here rsyslog config files get reloaded by the postrotate option of logrotate, presumably in order to stop rsyslog from writing to the old (now compressed or renamed logfile) and to the new logfile. Usually this looks like

 postrotate
            invoke-rc.d rsyslog rotate > /dev/null
 endscript

I believe this is now outdated, since rsyslog has been converted to upstart, and is no longer Sys V Init so something along the lines of

service rsyslog reload > /dev/null

is probably the way to go.

But what about the "rotate" action? (I think it was a logrotate custom action...somehow set via policy-rc.d perhaps..). I presume for Sys V Init this was somehow superior to a simple reload/restart (although I don't know exactly why), is it possible or desired in the new upstart framework to get logrotate use a "rotate" action to restart rsyslog rather than just doing a reload?

share|improve this question

1 Answer 1

Upstart is an init system, not a log rotater. Use a simple shell script (not an init script though) to rotate the logs.

share|improve this answer

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.