I have two syslog-ng servers in a cluster (hot/cold), both mapping the same NFS Share. I would like to run logrotate on the syslog servers to rotate the logs stored on the NFS Share. The problem is that currerntly if both nodes have a /etc/logrotate.d/syslog-ng
configuration, it would cause double rotation.
I am thinking there must be a way to use a prerotate
stanza in logrotate.d
to determine whether or not the rotate should happen on a server. In other words, If the passive node tries to run logrotate
, the prerotate
script would check first the node is primary. If it is not primary, I want the prerotate
script to exit
the logrotate
process before it runs.
Can someone point me in the right direction to figure out how to make a logrotate prerotate
script exit
its parent logrotate
process?