[Asterisk-Dev] What would prevent logs from being recreated ifthey are deleted?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Dec 15 02:12:13 MST 2005


On Wed, Dec 14, 2005 at 03:42:13PM -0500, James Armstrong wrote:
> I also have this problem. The logs are created, but when they too big I 
> delete them and they are not recreated until I restart Asterisk.

You don't delete a an active log file just because if it is too big: it
won't help. Remember that in unix file systems there is actually no
operation called "delete". 'rm' uses the system call unlink to dettach
that file from the filesystem. However if the file is also linked from
somewhere else it will not be deleted yet. In this case it was still
open as a log file for Asterisk.

So what can you do?

1. find the process that holds the log file open and either convince it
to close the file or kill it. 'logger reload' was already mentioned.

2. don't delete (unlink) it: zero its content. Rather safe with a log
file, may not be so with some data files. e.g: 

  echo -n >olg/file

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen at xorcom.com  http://www.xorcom.com



More information about the asterisk-dev mailing list