View Single Post
Old 5th April 2012, 17:13   #1
Junior Member
Join Date: Apr 2012
Posts: 4
Shoutcast 2 DNAS - log rotation and inconsistencies


We currently use DNAS logs to create daily reports of the radio's audience.

Our report script expects the day logs to be on the _1.log file, which is created every night when shoutcast is restarted by a cron job at 2:30 AM.

That said, here's our problem: When the radio needs to be restarted for some reason (configuration change, server crash, whatever...) the logs are automatically rotated and that causes the report script to miss relevant data, since _1.log will be rotated and become _2.log.

Let me try to make things clearer with an example:

Suppose it's 2:30 PM now and the server crashes. When it comes back up, shoutcast will be started and the logs will be rotated by sc_serv. Now we have a _1.log which has all data from 2:30 AM to 2:30 PM. Then shoutcast starts logging on another file till 2:30 AM, when the scheduled restart will run and cause the logs to be rotated again. Our daily report script then runs and collects all data from _1.log, but will miss all data on _2.log, which recorded everything that happened from 2:30 PM to 2:30 AM.

So, is there a way to prevent sc_serv from rotating its own logs when it starts?

This way I can use the Linux logrotate tool and be sure that there'll be no inconsistencies on our reports.

(I believe logs are also rotated when shoutcast stops, but I know I can avoid this by sending a SIGKILL to the process)

Any other suggestions are very welcome.

Thank you.
luis.alen is offline   Reply With Quote