Uptime counters (was RE: [Asterisk-Users] Bayonne and Asterisk)

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Thu Nov 20 07:37:46 MST 2003


> You can not rotate logs with out dropping calls,  and if logs get a
> little over 2Gbs Asterisk will crashes...

Why not?  Why are the logfiles kept open for the entire life of Asterisk?  
Hell even my heavily loaded qmail server isn't this braindead in that 
regard.

If * can be patched to open, write, close for every log write it is trivial 
to rotate logs:

mv /path/to/logfile /path/to/logfile.old
while fuser -s /path/to/logfile.old ; do sleep 1 ; done
bzip2 -1 /path/to/logfile.old

and you're done.  mv does not change the inode, so asterisk does not notice 
it if it _is_ in the middle of a write, and the fuser do/while loop waits 
patiently until asterisk is done with the file.  Next time Asterisk tries 
to open the file it will fail (since it doesn't exist) and will recreate 
it.  Piece of cake.

Regards,
Andrew



More information about the asterisk-users mailing list