<p></p>
<p>The commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/0436af5abd8b73e17f65020c74943f0f3b72ba0d/hovercard" href="https://github.com/kamailio/kamailio/commit/0436af5abd8b73e17f65020c74943f0f3b72ba0d"><tt>0436af5</tt></a> breaks startup for jsonrpcs module.</p>
<p>Logs:</p>
<pre><code>Jul  5 10:04:41 kam01 kamailio[4951]: ERROR: jsonrpcs [jsonrpcs_sock.c:358]: jsonrpc_dgram_init_server(): failed to change the owner/group for /var/run/kamailio/kamailio_rpc.sock  to 33.0;Operation not permitted[1]
Jul  5 10:04:41 kam01 kamailio[4951]: CRITICAL: jsonrpcs [jsonrpcs_sock.c:423]: jsonrpc_dgram_init_socks(): initializing datagram server function returned error
Jul  5 10:04:41 kam01 kamailio[4951]: ERROR: jsonrpcs [jsonrpcs_sock.c:246]: jsonrpc_dgram_mod_init(): init datagram sockets function failed
Jul  5 10:04:41 kam01 kamailio[4951]: ERROR: jsonrpcs [jsonrpcs_mod.c:1150]: mod_init(): cannot initialize datagram transport
Jul  5 10:04:41 kam01 kamailio[4951]: ERROR: <core> [core/sr_module.c:849]: init_mod(): Error while initializing module jsonrpcs (/usr/lib/x86_64-linux-gnu/kamailio/modules/jsonrpcs.so)
</code></pre>
<p>Relevant cfg:</p>
<pre><code>loadmodule "jsonrpcs.so"
modparam("jsonrpcs", "pretty_format", 1)
modparam("jsonrpcs", "dgram_user", "www-data")
modparam("jsonrpcs", "dgram_group", "root")
modparam("jsonrpcs", "transport", 7)
</code></pre>
<p>Previously Kamailio was started as root, and then configured with -u $USER and -g $GROUP to drop privileges to the lower user/group. During startup Kamailio could create the socket with the correct permissions.<br>
The mentioned commit changes this to: start Kamailio directly as user Kamailio and group Kamailio, which don't have privileges create the sockets with the correct permissions.</p>
<p>Not sure about the motivation about this change, so I don't want to simple revert it. Maybe <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/sergey-safarov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sergey-safarov">@sergey-safarov</a> or other developers can comment.</p>

<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/2391">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNSMTKVGPKL7U354MDR2BGTHANCNFSM4OQZWM4A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMDUWHZVL24SQB7FADR2BGTHA5CNFSM4OQZWM4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JWOC5AA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2391",
"url": "https://github.com/kamailio/kamailio/issues/2391",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>