<div>Anton,</div><div><br></div>When you are trying to start it are you starting it using the -u opensips and -g opensips command line options to have it run as opensips user and group?<div>That way in the startup script you can easily remove the dead pid as root (checking first to be sure opensips is not actually running).</div>
<div><br></div><div>Dave<br><br><div class="gmail_quote">On Thu, Feb 24, 2011 at 11:55 PM, Anton Zagorskiy <span dir="ltr"><<a href="mailto:a.zagorskiy@oyster-telecom.ru">a.zagorskiy@oyster-telecom.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="RU" link="blue" vlink="purple"><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D">Hi, Dave.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D">The problem was I’v started openSIPS under not opensips user. With ‘sudo –u opensips /usr/local/sbin/opensips …’ openSIPS starts well.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D">But now it seems that pid file isn’t erased when openSIPS failed to start.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D"> </span></p></div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a> [mailto:<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>] <b>On Behalf Of </b>Dave Singer<br>
<b>Sent:</b> Friday, February 25, 2011 4:14 AM<br><b>To:</b> OpenSIPS users mailling list<br><b>Subject:</b> Re: [OpenSIPS-Users] running opensips under another user</span></p></div></div><div><div></div><div class="h5">
<p class="MsoNormal">
</p><div><p class="MsoNormal"><span><span style="font-size:10.0pt">Anton,</span></span></p></div><p class="MsoNormal">Have you checked the selinux logs?</p><div><p class="MsoNormal">Search the list about selinux. A couple months back I posted what I ran into and how to solve it fairly simply.</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Dave.</p><div><p class="MsoNormal">On Thu, Feb 24, 2011 at 6:23 AM, Duane Larson <<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>> wrote:</p>
<div><p class="MsoNormal">And you're positive that the /var/run/opensips directory is owned by the opensips:opensips user and group? All I ever do is</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">
sudo mkdir /var/run/opensips/<br>sudo chown opensips:opensips /var/run/opensips</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Never had that issue.</p></div><div><p class="MsoNormal"> </p></div>
<div>
<p class="MsoNormal">cd /var/run</p></div><div><p class="MsoNormal">ls -la</p></div><div><p class="MsoNormal">drwxr-xr-x 2 opensips opensips 4096 Feb 24 08:23 opensips</p></div><div><div><div><p class="MsoNormal">
</p>
</div><div><p class="MsoNormal"><br><br> </p></div><div><p class="MsoNormal">On Thu, Feb 24, 2011 at 3:07 AM, Anton Zagorskiy <<a href="mailto:a.zagorskiy@oyster-telecom.ru" target="_blank">a.zagorskiy@oyster-telecom.ru</a>> wrote:</p>
<p class="MsoNormal">Hi.<br><br>I've made a user opensips with group opensips and with shell nologin.<br>Also, I've created /var/run/opensips with opensips::opensips and access mode<br>775<br><br>Next, running openSIPS with -u opensips -g opensips -P<br>
/var/run/opensips/opensips.pid<br>And opensips failed to start with:<br><br>ERROR:core:daemonize: unable to create pid file<br>/var/run/opensips/opensips.pid: Permission denied<br><br><br>A command "sudo -u opensips touch /var/run/opensips/opensips1.pid" works<br>
well.<br><br>What I'm doing wrong?<br><br><br><br>WBR, Anton Zagorskiy<br>VoIP Developer, Oyster Telecom<br>Phone.: <a href="tel:%2B7%20812%20601-0666" target="_blank">+7 812 601-0666</a><br>Fax: <a href="tel:%2B7%20812%20601-0593" target="_blank">+7 812 601-0593</a><br>
<a href="mailto:a.zagorskiy@oyster-telecom.ru" target="_blank">a.zagorskiy@oyster-telecom.ru</a><br><a href="http://www.oyster-telecom.ru/" target="_blank">www.oyster-telecom.ru</a><br><br><br><br><br><br>_______________________________________________<br>
Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></p>
</div><p class="MsoNormal"><br><br clear="all"></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt">-- <br>--<br>*--*--*--*--*--*<br>Duane<br>*--*--*--*--*--*<br><span style="color:#888888">--<br></span><br>
_______________________________________________<br>
Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></p>
</div><p class="MsoNormal"> </p></div></div></div></div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>