<p>Sean Bright <strong>uploaded patch set #2</strong> to the change originally created by George Joseph.</p><p><a href="https://gerrit.asterisk.org/10830">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ast_coredumper:  Refactor the pid determination process<br><br>In order to get a dump of the running process, we need to find the<br>pid of the main asterisk process.  This can be tricky if there are<br>also instances of "asterisk -r" running or if an alternate location<br>for asterisk.conf was specified on the command line with the -C<br>option that also specified an alternation location for the pid file.<br><br>So now...<br><br>1. We find the asterisk executable with "which" or the --asterisk-bin<br>   command line option.<br>2. If there's only 1 process with an executable path that matches,<br>   we use that pid.  If not...<br>3. We try "<asterisk-bin> -rx 'core show settings'" and parse the<br>   output to find the pidfile, then read that for the pid.  If that<br>   didn't work...<br>4. We get a list of all the pids matching <asterisk-bin> and look<br>   in /proc/<pid>/cmdline for a -C argument and retry the "core show<br>   settings" using the same -C option.  We can't parse the output<br>   of "ps" to get the -C path because it may contain spaces.  The<br>   contents of /proc/<pid>/cmdline are delimited by NULLs.  For BSDs<br>   we may have to mount /proc first. :(<br><br>ASTERISK-28221<br>Reported by: Andrew Nagy<br><br>Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c<br>---<br>M contrib/scripts/ast_coredumper<br>1 file changed, 84 insertions(+), 29 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/10830/2</pre><p>To view, visit <a href="https://gerrit.asterisk.org/10830">change 10830</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10830"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c </div>
<div style="display:none"> Gerrit-Change-Number: 10830 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>