<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 3:48 AM, <span dir="ltr"><<a href="mailto:pierre.guyard@orange.com" target="_blank">pierre.guyard@orange.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="FR">
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,<br>
<br>
I have a problem related to the Asterisk CLI, when I enter "asterisk -rv", it cannot display the Asterisk CLI and instaed, I have this message "Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)."<br>
<br>
When I check with "locate asterisk.ctl", it is indeed in the repertory "/var/run/".<br>
<br>
So after searching I have found we can enter "ps -A | grep asterisk" in order to find an asterisk "ghost" running and then kill it, and I have found:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><code><span style="font-size:10.0pt" lang="EN-US">1474 ? 00:00:14 asterisk</span></code><span style="font-size:10.0pt;font-family:"Courier New"" lang="EN-US"><br>
<code>1615 pts/3 00:00:13 asterisk</code><br>
<code>31411 ? 00:00:00 safe_asterisk</code><br>
<code>31414 ? </code></span><code><span style="font-size:10.0pt">01:08:53 asterisk<u></u><u></u></span></code></p>
<p class="MsoNormal"><code><span style="font-size:10.0pt"><u></u> <u></u></span></code></p>
<p class="MsoNormal"><span lang="EN-US">I don't know if it's the case and which one of these I should kill?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Furthermore, I can access to the CLI with “asterisk –cv” but I often got the following warning : “db.c:288 db_execute_sql: Error executing SQL (COMMIT): database is locked”.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Otherwise, is there another way to fix my problem?<br>
<br>
Thank you in advance!</span><br clear="all"></p></div></div></blockquote></div><br></div><div class="gmail_extra">I would suspect that you have installed Asterisk in such a fashion that a particular user or user with certain permissions is required to access the /var/run directory, as well as other directories Asterisk uses (such as where it stores the AstDB).<br><br></div><div class="gmail_extra">You are then probably running the safe_asterisk script under a user without sufficient permissions, and/or running/invoking the Asterisk CLI (via "asterisk -rv") as a user with insufficient permissions.<br><br></div><div class="gmail_extra">I would double check:<br></div><div class="gmail_extra">(1) What user/groups own the various Asterisk directories (specified in your asterisk.conf)<br></div><div class="gmail_extra">(2) What user/group you are running the safe_asterisk script under<br></div><div class="gmail_extra">(3) What user/group you are running as when you attempt to connect to Asterisk<br><br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Director of Technology<br></div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div></div></div></div>
</div></div>