ben-xo
15th July 2003, 15:18
Hi,
I have set up a shoutcast server for a client which is deliberately limited to only 3 hours per week in order to make sure that they don't wildly abuse their bandwidth quota by accident, and i've written some lovely startup/shutdown/log parsing scripties to go with it.
The problem is, when i kill sc_serv with SIGTERM, the logging is left sorely incomplete:
<07/15/03@16:09:09> [source] connected from 217.39.150.57
<07/15/03@16:09:09> [source] icy-name:Live! (Kaizen Radio) ; icy-genre:Drum & Bass
<07/15/03@16:09:09> [source] icy-pub:0 ; icy-br:64 ; icy-url:http://www.kaizenrecords.com/
<07/15/03@16:09:09> [source] icy-irc:N/A ; icy-icq:N/A ; icy-aim:N/A
<07/15/03@16:09:16> [dest: 217.39.xx.xx] starting stream (UID: 0)[L: 1]{A: WinampMPEG/2.8}(P: 0)
<07/15/03@16:11:47> [main] SIGTERM; exiting!
Notice that 217.39.xx.xx starts streaming at 16:09:16.
217.39.xx.xx clearly must have stopped streaming by 16:11:47, as that is when the stream shuts down, BUT there is no corresponding "connection closed" line, which means that parsing the logs to determine the total amount of bandwidth consumed will not include anyone who attempted to stay listening longer than the server was up for. As closing connections is a natural part of shutting down, i feel that this is a bug in sc_serv.
I cannot think of any viable work-arounds at the moment and i'd like some suggestions if anyone can think of any!
I suppose it might be possible to dynamically switch config files (to one which has 0 listeners maximum), SIGUSR1 to reload, and then boot everyone off the stream 1 by 1 before shutting down... ughhh...
I have set up a shoutcast server for a client which is deliberately limited to only 3 hours per week in order to make sure that they don't wildly abuse their bandwidth quota by accident, and i've written some lovely startup/shutdown/log parsing scripties to go with it.
The problem is, when i kill sc_serv with SIGTERM, the logging is left sorely incomplete:
<07/15/03@16:09:09> [source] connected from 217.39.150.57
<07/15/03@16:09:09> [source] icy-name:Live! (Kaizen Radio) ; icy-genre:Drum & Bass
<07/15/03@16:09:09> [source] icy-pub:0 ; icy-br:64 ; icy-url:http://www.kaizenrecords.com/
<07/15/03@16:09:09> [source] icy-irc:N/A ; icy-icq:N/A ; icy-aim:N/A
<07/15/03@16:09:16> [dest: 217.39.xx.xx] starting stream (UID: 0)[L: 1]{A: WinampMPEG/2.8}(P: 0)
<07/15/03@16:11:47> [main] SIGTERM; exiting!
Notice that 217.39.xx.xx starts streaming at 16:09:16.
217.39.xx.xx clearly must have stopped streaming by 16:11:47, as that is when the stream shuts down, BUT there is no corresponding "connection closed" line, which means that parsing the logs to determine the total amount of bandwidth consumed will not include anyone who attempted to stay listening longer than the server was up for. As closing connections is a natural part of shutting down, i feel that this is a bug in sc_serv.
I cannot think of any viable work-arounds at the moment and i'd like some suggestions if anyone can think of any!
I suppose it might be possible to dynamically switch config files (to one which has 0 listeners maximum), SIGUSR1 to reload, and then boot everyone off the stream 1 by 1 before shutting down... ughhh...