<p></p>
<p>Environment:</p>
<pre><code>DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
</code></pre>
<p>Kamailio installed from:</p>
<pre><code>/etc/apt/sources.list
deb     http://deb.kamailio.org/kamailio53 xenial main
deb-src http://deb.kamailio.org/kamailio53 xenial main
</code></pre>
<p>After Kamailio start, ownership of <code>/var/run/kamailio/</code> and related files looks like:</p>
<pre><code># ls -l  /var/run/kamailio/
total 4
srw-rw---- 1 kamailio kamailio 0 May 20 15:41 kamailio_ctl
-rw-r--r-- 1 kamailio kamailio 5 May 20 15:41 kamailio.pid
prw-rw---- 1 root     root     0 May 20 15:41 kamailio_rpc.fifo
srw-rw---- 1 root     root     0 May 20 15:41 kamailio_rpc.sock
# ls -ld  /var/run/kamailio/
drwxr-x--- 2 root root 120 May 20 15:41 /var/run/kamailio/
</code></pre>
<p>Note 'root' ownership.<br>
This causes these errors during Kamailio stop and probabaly some other issues too.</p>
<pre><code>May 20 16:11:24 sip01 /usr/sbin/kamailio[5919]: ERROR: jsonrpcs [jsonrpcs_fifo.c:599]: jsonrpc_fifo_destroy(): FIFO stat failed: Permission denied
May 20 16:11:24 sip01 /usr/sbin/kamailio[5919]: ERROR: jsonrpcs [jsonrpcs_sock.c:516]: jsonrpc_dgram_destroy(): socket stat failed: Permission denied
May 20 16:11:24 sip01 /usr/sbin/kamailio[5919]: ERROR: ctl [ctl.c:390]: mod_destroy(): ERROR: ctl: could not delete unix socket /var/run/kamailio//kamailio_ctl: Permission denied (13)
</code></pre>
<p>To get the ownership right I have to modify <code>/lib/systemd/system/kamailio.service</code><br>
and add:</p>
<pre><code>User=kamailio
Group=kamailio
</code></pre>
<p>Now ownership after start looks like bellow and stops are clean too.</p>
<pre><code># ls -l  /var/run/kamailio/
total 4
srw-rw---- 1 kamailio kamailio 0 May 20 15:52 kamailio_ctl
-rw-r--r-- 1 kamailio kamailio 5 May 20 15:52 kamailio.pid
prw-rw---- 1 kamailio kamailio 0 May 20 15:52 kamailio_rpc.fifo
srw-rw---- 1 kamailio kamailio 0 May 20 15:52 kamailio_rpc.sock
# ls -ld  /var/run/kamailio/
drwxr-x--- 2 kamailio kamailio 120 May 20 15:52 /var/run/kamailio/
</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/2334">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOSKI22A3F4IRHNKZ3RSQ3ZLANCNFSM4NGJAG5Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPHDQSLE5SDA7OKWNTRSQ3ZLA5CNFSM4NGJAG52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JIT4IZQ.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/2334",
"url": "https://github.com/kamailio/kamailio/issues/2334",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>