<p>Starting Kamailio (4.4 with branch updates through <a href="https://github.com/kamailio/kamailio/commit/e43d82db89e57a47418d4ccdd283d8b2de82e7e6" class="commit-link"><tt>e43d82d</tt></a> applied) with the following systemd unit file, native systemd/journald logging doesn't work as expected.  I <em>do</em> get core logging when I use</p>

<pre><code>log_engine_type="systemd"
loadmodule "log_systemd.so"
</code></pre>

<p>but <code>xlog</code> and <code>sd_journal_print</code> <em>don't</em> send anything to the journal.</p>

<p>When I comment out <code>log_engine_type</code>, keeping the log_systemd.so module loaded,  <code>sd_journal_print</code> <em>does</em> log the messages properly to the systemd journal, <code>xlog</code> and core startup messages are sent to syslog.</p>

<p>If I change the service to <code>Type=simple</code> and add the <code>-D</code> option to <code>ExecStart</code> to disable forking, then logging to systemd via <code>xlog</code> and <code>sd_journal_print</code> works, but TCP/TLS listeners aren't created.</p>

<pre><code>[Unit]
Description=Kamailio SIP Server
Documentation=man:kamailio(8) http://www.kamailio.org/
After=syslog.target network-online.target
Wants=network-online.target

[Service]
Type=forking
User=kamailio
Environment=SHM_SIZE=64
Environment=PKG_SIZE=8
ExecStartPre=/usr/sbin/kamailio -c
ExecStart=/usr/sbin/kamailio -m $SHM_SIZE -M $PKG_SIZE -P /run/kamailio/kamailio.pid
PIDFile=/run/kamailio/kamailio.pid
Restart=on-failure
RestartSec=30
RuntimeDirectory=kamailio
RuntimeDirectoryMode=0750

[Install]
WantedBy=multi-user.target
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/799">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZdS7uGKu7CYCC5yf0MYJJ7fMCKK1ks5quGoRgaJpZM4KHJxh">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Zabh-Zpqs4jLvbZ7rAA_AQUy7DbCks5quGoRgaJpZM4KHJxh.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/799"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Unexpected log_systemd behavior when daemon is forked (#799)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/799"}}}</script>