On Thu, 2010-04-22 at 15:13 +0400, Nikolay Kondratyev wrote:
> Hi all,
> A bit earlier in the list i found a command for manual log rotating.
> I tried 
> logrotate -f /etc/logrotate.d/sipxchange
> And all logs were rotated except sipxcallresolver.log. 
> And i noticed that it was never rotated... and is 200M long now.
>  
> I believe it is due to the following lines
> in /etc/logrotate.d/sipxchange file:
>  
> # Now we list the files, excluding sipxconfig.log.  If you have
> # a log file that starts with 's' but not with 'sip', and you
> # want it rotated w/o copytruncate, list full path name here
> /var/log/sipxpbx/sip?[!c]*.log /var/log/sipxpbx/[!sf]*.log {
> }
>  
>  
> I changed it to 
> # Now we list the files, excluding sipxconfig.log.  If you have
> # a log file that starts with 's' but not with 'sip', and you
> # want it rotated w/o copytruncate, list full path name here
> /var/log/sipxpbx/sip?[!c]*.log /var/log/sipxpbx/[!
> sf]*.log /var/log/sipxpbx/sipxcallresolver.log {
> }
> 
> and sipxcallresolver.log was rotated after logrotate. 
> but i noticed that messages like 
> "2010-04-22T14:54:02.895028 ":DEBUG:Waking up.
> "2010-04-22T14:54:02.895172 ":DEBUG:Read CSEs from ID:27405 Time:
> "2010-04-22T14:54:02.896245 ":DEBUG:Going to sleep.
> "2010-04-22T14:54:12.898498 ":DEBUG:Waking up.
> "2010-04-22T14:54:12.898635 ":DEBUG:Read CSEs from ID:27405 Time:
> "2010-04-22T14:54:12.899724 ":DEBUG:Going to sleep.
> are still being written into sipxcallresolver.log.1, while
> sipxcallresolver.log is not created....
>  
> Looks like i did something wrong...

No, you didn't do anything wrong.  The problem lies in how the call
resolver writes to the log.   Most of the services implement a logging
scheme in which every so often (I forget off hand whether it's based on
time or the number of log entries), the logging component closes and
reopens the file.  This is key to being able to easily rotate the logs -
when logrotate renames the file, if the process that's writing to it
doesn't close and reopen it then it just keeps writing to the old name
(what you saw).  If the process closes it and reopens, then it gets a
new file on the open (this is why we don't compress the most recently
rotated log... it allows the process to keep writing to the old name for
a little while.

> I see this in 4.0.4.
> Is it fixed in 4.2?
> What can be done to fix the probem?

There are a couple of possibilities, both of which require changes to
the call resolver:

     1. Change the logging to do what other components do: every now and
        then close and reopen the log file.
     2. Restart the call resolver whenever its log is rotated (by adding
        a script into the logrotate configuration file).

Raymond - do you think this is fixed in 4.2?  If not, then Nikolay
should open an issue (good catch).



_______________________________________________
sipx-users mailing list sipx-users@list.sipfoundry.org
List Archive: http://list.sipfoundry.org/archive/sipx-users
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-users
sipXecs IP PBX -- http://www.sipfoundry.org/

Reply via email to