[CentOS] read permission on rotated logs

Pete Biggs pete at biggs.org.uk
Thu Mar 14 15:52:13 UTC 2019


On Thu, 2019-03-14 at 15:45 +0000, Leroy Tennison wrote:
> Maybe I'm missing something here but doesn't logrotate have the
> 'postrotate ... endscript' block for its configuration files where
> you can run any command you desire?

The problem is knowing the name that the logfile has just been rotated
to. The script is only passed the name of the logfile itself and I
don't think the name can be accurately constructed from that.

That's why I said some combination of pre- and post- rotate.  Something
like in the prerotate section change the ownership and permissions,
then when it's rotated it should be correct.  The create command can
then be used to make sure the newly created logfile has the correct
ownership/permission.

P.




More information about the CentOS mailing list