[sr-dev] [kamailio/kamailio] Unexpected log_systemd behavior when daemon is forked (#799)

Anthony Messina notifications at github.com
Fri Nov 22 03:30:06 CET 2019


> Got a bit of time to test this with latest master and it seems to work with following basic config:
> 
> ```
> #!KAMAILIO
> 
> ####### Global Parameters #########
> 
> ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
> debug=2
> log_stderror=no
> 
> memdbg=5
> memlog=5
> 
> log_facility=LOG_LOCAL0
> log_prefix="{$mt $hdr(CSeq) $ci} "
> 
> /* number of SIP routing processes */
> children=2
> 
> log_engine_type="systemd"
> 
> ####### Modules Section ########
> 
> /* set paths to location of modules */
> # mpath="/usr/local/lib/kamailio/modules/"
> 
> loadmodule "log_systemd.so"
> loadmodule "jsonrpcs.so"
> loadmodule "kex.so"
> loadmodule "corex.so"
> loadmodule "tm.so"
> loadmodule "tmx.so"
> loadmodule "sl.so"
> loadmodule "rr.so"
> loadmodule "pv.so"
> loadmodule "maxfwd.so"
> loadmodule "textops.so"
> loadmodule "siputils.so"
> loadmodule "xlog.so"
> loadmodule "sanity.so"
> loadmodule "ctl.so"
> loadmodule "cfg_rpc.so"
> loadmodule "counters.so"
> 
> 
> 
> ####### Routing Logic ########
> 
> 
> /* Main SIP request routing logic
>  * - processing of any incoming SIP request starts with this route
>  * - note: this is the same as route { ... } */
> request_route {
> 	xlog("===== test xlog message - R-URI is $ru\n");
> 	sd_journal_print("LOG_ERR", "+++++ test sysd message - R-URI is $ru\n");
> 	sl_send_reply("200", "ok");
> 	exit;
> }
> ```
> 
> I sent test packets with sipsak, and in journalctl I see:
> 
> ```
> root at portugal ~ # journalctl -f
> -- Logs begin at Tue 2018-09-11 19:12:04 CEST. --
> Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
> Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992
> Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
> Sep 17 12:14:06 portugal kamailio[4553]: INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/4553
> Sep 17 12:14:06 portugal kamailio[4554]: INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)
> Sep 17 12:14:48 portugal kamailio[4541]: ERROR: {1 1 OPTIONS 1446075015 at 127.0.1.1} <script>: ===== test xlog message - R-URI is sip:test at 127.0.0.1
> Sep 17 12:14:48 portugal kamailio[4541]: +++++ test sysd message - R-URI is sip:test at 127.0.0.1
> Sep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session opened for user root by (uid=0)
> Sep 17 12:17:01 portugal CRON[4568]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
> Sep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session closed for user roo
> Sep 17 12:20:00 portugal kamailio[4542]: ERROR: {1 1 OPTIONS 306190950 at 127.0.1.1} <script>: ===== test xlog message - R-URI is sip:test at 127.0.0.1
> Sep 17 12:20:00 portugal kamailio[4542]: +++++ test sysd message - R-URI is sip:test at 127.0.0.1
> ```
> 
> Kamailio was compiled and started from source tree with:
> 
> ```
>  ./src/kamailio -f ../etc/kamailio-logsystemd.cfg -L src/modules/ -a no
> ```
> 
> Given that the report was made for an old version, I am going to close this issue. Test with master or 5.1 and if you still have issues, then open a new item with relevant details for the newer versions. Try to use this basic config to see if behaves differently. I tested on Debian stable.

I've tried this again--part of the issue is related to multiple `listener=` lines.  If you update the config above to add
```
listen=lo
listen=eno1
```
`log_engine_type="systemd"` will fail.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/799#issuecomment-557359980
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191121/6f7cf798/attachment-0001.html>


More information about the sr-dev mailing list