This queue is for tickets about the Sphinx-Manager CPAN distribution.

Report information
The Basics
Id:
83200
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
tlyons [...] ivenue.com
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
0.06
Fixed in:
(no value)



Subject: Running under mod_perl inherits apache listening ports
A programmer used this module to detect absence of and start searchd from inside of Apache (mod_perl with Catalyst and RoseDB). When this occurs, the process tree looks like this: ├─searchd(31838)───searchd(31839)─┬─{searchd}(31840) │ ├─{searchd}(31841) │ └─{searchd}(31842) KVM-CentOS58[root@ivwww41 script]# lsof -P -p 31838 | grep LISTEN; echo; lsof -P -p 31839 | grep LISTEN searchd 31838 www 4u IPv6 852945 0t0 TCP *:81 (LISTEN) searchd 31838 www 6u IPv6 852950 0t0 TCP *:86 (LISTEN) searchd 31838 www 8u IPv6 852955 0t0 TCP *:444 (LISTEN) searchd 31838 www 10u IPv6 852960 0t0 TCP *:88 (LISTEN) searchd 31839 www 4u IPv6 852945 0t0 TCP *:81 (LISTEN) searchd 31839 www 6u IPv6 852950 0t0 TCP *:86 (LISTEN) searchd 31839 www 8u IPv6 852955 0t0 TCP *:444 (LISTEN) searchd 31839 www 10u IPv6 852960 0t0 TCP *:88 (LISTEN) searchd 31839 www 24u IPv4 853632 0t0 TCP *:9312 (LISTEN) searchd 31839 www 25u IPv4 853633 0t0 TCP *:9306 (LISTEN) The parent process never dies, so when you restart apache, it kills all the running httpd processes leaving this process as the primary listener on those ports, preventing apache from starting back up. Stopping httpd: [ OK ] Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:81 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:81 no listening sockets available, shutting down Unable to open logs Suggestion is to detect and unbind any listening ports before the first fork, or maybe between the two forks. I am not sure which is more correct (if at all).
Subject: Re: [rt.cpan.org #83200] Running under mod_perl inherits apache listening ports
Date: Fri, 08 Feb 2013 16:40:01 +1030
To: bug-Sphinx-Manager@rt.cpan.org
From: Jon Schutz <jon.schutz@youramigo.com>
On 08/02/13 07:23, Todd Lyons via RT wrote:
Show quoted text
> Thu Feb 07 15:53:33 2013: Request 83200 was acted upon. > Transaction: Ticket created by mrballcb > Queue: Sphinx-Manager > Subject: Running under mod_perl inherits apache listening ports > Broken in: 0.06 > Severity: Important > Owner: Nobody > Requestors: tlyons@ivenue.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83200 > > > > A programmer used this module to detect absence of and start searchd > from inside of Apache (mod_perl with Catalyst and RoseDB). When this > occurs, the process tree looks like this: > > ├─searchd(31838)───searchd(31839)─┬─{searchd}(31840) > │ ├─{searchd}(31841) > │ └─{searchd}(31842) > > KVM-CentOS58[root@ivwww41 script]# lsof -P -p 31838 | grep LISTEN; echo; > lsof -P -p 31839 | grep LISTEN > searchd 31838 www 4u IPv6 852945 0t0 TCP *:81 (LISTEN) > searchd 31838 www 6u IPv6 852950 0t0 TCP *:86 (LISTEN) > searchd 31838 www 8u IPv6 852955 0t0 TCP *:444 (LISTEN) > searchd 31838 www 10u IPv6 852960 0t0 TCP *:88 (LISTEN) > > searchd 31839 www 4u IPv6 852945 0t0 TCP *:81 (LISTEN) > searchd 31839 www 6u IPv6 852950 0t0 TCP *:86 (LISTEN) > searchd 31839 www 8u IPv6 852955 0t0 TCP *:444 (LISTEN) > searchd 31839 www 10u IPv6 852960 0t0 TCP *:88 (LISTEN) > searchd 31839 www 24u IPv4 853632 0t0 TCP *:9312 (LISTEN) > searchd 31839 www 25u IPv4 853633 0t0 TCP *:9306 (LISTEN) > > The parent process never dies, so when you restart apache, it kills all > the running httpd processes leaving this process as the primary listener > on those ports, preventing apache from starting back up. > > Stopping httpd: [ OK ] > Starting httpd: (98)Address already in use: make_sock: could not bind to > address [::]:81 > (98)Address already in use: make_sock: could not bind to address 0.0.0.0:81 > no listening sockets available, shutting down > Unable to open logs > > Suggestion is to detect and unbind any listening ports before the first > fork, or maybe between the two forks. I am not sure which is more > correct (if at all).
Hi Todd, Please find an experimental version attached. It should work out-of-the-box but you can customise the behaviour using the pre_exec_callback if you wish (see docs). I don't have a mod_perl setup to test with, so let me know if this solves your problem, then I will release to cpan. -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com

Message body not shown because it is not plain text.

From: tlyons@ivenue.com
On Fri Feb 08 01:10:19 2013, jon.schutz@youramigo.com wrote:
Show quoted text
> > Hi Todd, > > Please find an experimental version attached. It should work > out-of-the-box but you can customise the behaviour using the > pre_exec_callback if you wish (see docs). I don't have a mod_perl > setup to test with, so let me know if this solves your problem, > then I will release to cpan.
We were unable to test it. We are running this on CentOS 5.8, which uses perl 5.8.8. This new module seemed to want POSIX::1003::Symbols, which we don't have available. Instead, we are going to just change our method of invocation. Rather than forking from inside of mod_perl, we are going to have a standalone service running in a separate VM. My apologies for being unable to test it, but we greatly appreciate the rapid response!
Subject: Re: [rt.cpan.org #83200] Running under mod_perl inherits apache listening ports
Date: Sun, 10 Feb 2013 20:18:07 +1030
To: bug-Sphinx-Manager@rt.cpan.org
From: Jon Schutz <jon.schutz@youramigo.com>
On 10/02/13 05:24, Todd Lyons via RT wrote:
Show quoted text
> Queue: Sphinx-Manager > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83200 > > > On Fri Feb 08 01:10:19 2013, jon.schutz@youramigo.com wrote:
>> Hi Todd, >> >> Please find an experimental version attached. It should work >> out-of-the-box but you can customise the behaviour using the >> pre_exec_callback if you wish (see docs). I don't have a mod_perl >> setup to test with, so let me know if this solves your problem, >> then I will release to cpan.
> We were unable to test it. We are running this on CentOS 5.8, which > uses perl 5.8.8. This new module seemed to want POSIX::1003::Symbols, > which we don't have available. Instead, we are going to just change our > method of invocation. Rather than forking from inside of mod_perl, we > are going to have a standalone service running in a separate VM. My > apologies for being unable to test it, but we greatly appreciate the > rapid response!
Hi Todd, Seems plain old POSIX works just as well, so I have updated the patch to work with 5.8.8 in case it is still useful to you. Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com

Message body not shown because it is not plain text.



This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.