[asterisk-bugs] [JIRA] (ASTERISK-25510) Log to syslog failing

Walter Doekes (JIRA) noreply at issues.asterisk.org
Thu Mar 24 05:15:56 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230008#comment-230008 ] 

Walter Doekes commented on ASTERISK-25510:
------------------------------------------

https://sourceware.org/bugzilla/show_bug.cgi?id=14347

LOG_MAKEPRI is broken in glibc < 2.17:
{noformat}
$ grep define[[:blank:]]*LOG_MAKEPRI /usr/include/x86_64-linux-gnu/sys/syslog.h
#define	LOG_MAKEPRI(fac, pri)	(((fac) << 3) | (pri))
{noformat}

It should be:
{noformat}
#define	LOG_MAKEPRI(fac, pri)	((fac) | (pri))
{noformat}

Suggested fix: drop the LOG_MAKEPRI macro and OR the two values together here:
{noformat}
+       syslog_level = LOG_MAKEPRI(facility, syslog_level);
{noformat}
(added in 29694eb2a (11-branch))

> Log to syslog failing
> ---------------------
>
>                 Key: ASTERISK-25510
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25510
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Logging
>    Affects Versions: 11.20.0
>         Environment: Scientific Linux 6.7, rsyslog 5.8.10
>            Reporter: Michael Newton
>
> This function worked fine in Asterisk 11.19 but since ASTERISK-25407 was checked-in syslog messages are being sent with an invalid priority and facility.
> Contents of logger.conf are as follows:
> {noformat}
> [general]
> appendhostname=no
> dateformat=%F %T
> queue_log=no
> rotatestrategy=rotate
> [logfiles]
> console => debug,dtmf,error,fax,notice,verbose,warning
> full => debug,error,fax,notice,verbose,warning
> messages => error,notice,warning
> security => security
> syslog.local3 => notice,warning
> {noformat}
> I was unable to capture log messages going to the local syslog server (anyone know how to capture socket traffic?) but here is what I see on a packet trace when relaying to a remote server:
> {noformat}
> IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 105)
>     192.168.242.172.60913 > 192.168.242.205.514: SYSLOG, length: 77
> 	Facility auth (4), Severity error (3)
> 	Msg: Oct 30 17:53:48 server1 asterisk: syslog: unknown facility/priority: 4c4
> IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 349)
>     192.168.242.172.60913 > 192.168.242.205.514: SYSLOG, length: 321
> 	Facility kernel (0), Severity emergency (0)
> 	Msg: invld>Oct 30 17:53:48 server1 asterisk: WARNING[2322]: chan_sip.c:4024 in retrans_pkt: Retransmission timeout reached on transmission df09fb87e9ee227d7818789fe271f0c9 for seqno 1 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions#012Packet timed out after 32000ms with no response
> {noformat}
> Note first is sent with a totally invalid value, the second with kernel.emergency.
> For reference, here is a capture from a server running the same config on 11.19:
> {noformat}
> IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 249)
>     192.168.242.167.37299 > 192.168.242.205.514: SYSLOG, length: 221
> 	Facility local3 (19), Severity notice (5)
> 	Msg: Oct 30 19:55:15 server2 asterisk[2284]: NOTICE[2321]: chan_sip.c:28309 in handle_request_register: Registration from '"Foo" <sip:7040 at server2>' failed for '2.3.4.54:56513' - Wrong password
> {noformat}
> Hopefully this is enough information to reproduce.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list