[sr-dev] deamonize.c and the option DSYSLOG_ASYNC Kamailio 1.5

Henning Westerholt henning.westerholt at 1und1.de
Tue Dec 1 01:55:51 CET 2009


On Donnerstag, 26. November 2009, Torben Friese wrote:
> [..]
> Another interesting thing is if you bring in a log at line 205
> (daemonize.c) it is working:
>
>         LM_ERR("what ever \n");
> 	for (r=3; r < 32; r++){
> 		close(r);
> 	}
>
> It seems that close() is not able to close the fd for the log (return
> value from mksock in syslog_async.c).
>
> But If I let the for-loop counter start at 4 it is still not working.
>
> After that I tried to set up log_fd as global( int log_fd=-1) and
> include the headers, to check the "r" against the log_fd before execute
> close(). But the same result.
>
> Also a correct close(closelog_async()) in deamonize do not work.
>
> I am open for any ideas, maybe I have oversight something. Could you
> reproduce this ?

Hello Torben,

i've just was able to reproduce this on 1.5 branch.

henning at ca:~/projects/openser/branches/1.5$ ./kamailio -V
version: kamailio 1.5.3-notls (i386/linux)
flags: STATISTICS, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, 
PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4194304
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
svnrevision: 2:5958M
@(#) $Id: main.c 5608 2009-02-13 16:48:17Z henningw $
main.c compiled on 00:29:27 Dec  1 2009 with gcc 4.3.3

Here i get log file output, regardsless if i use log_stderror or not, but only 
with debug=3.

Dec  1 00:33:47 [7985] INFO:core:init_tcp: using epoll_lt as the TCP io watch 
method (auto detected)
Dec  1 00:33:47 [7987] ERROR:core:main: install asynchronous syslog handler..                       
Dec  1 00:33:47 [7987] NOTICE:core:main: version: kamailio 1.5.3-notls 
(i386/linux)   

The second log msg was added from me, to see if the correct function is 
called.

This is on a kubuntu 9.04, with version 1.5-5ubuntu3 of sysklogd. 

When i use debug=2 in the cfg, aparently it not works.. Interesting, i'll 
investigate more.

Regards,

Henning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20091201/08f3b02c/attachment.htm>


More information about the sr-dev mailing list