Bug 492378 - jabberd probably does not close its stdin/stdout/stderr, starting in from a script does not finish
Summary: jabberd probably does not close its stdin/stdout/stderr, starting in from a s...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: jabberd
Version: 10
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Adrian Reber
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-26 16:59 UTC by Jan Pazdziora
Modified: 2009-04-02 18:21 UTC (History)
2 users (show)

Fixed In Version: 2.2.4-4.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-02 17:10:53 UTC
Type: ---


Attachments (Terms of Use)

Description Jan Pazdziora 2009-03-26 16:59:15 UTC
Description of problem:

We've recently come across a problem with jabberd. When we start its init.d/jabberd from a script which reads its stdout, the last read never finishes (until the jabberd is killed). All the jabberd daemons should probably close its stdouts/stderrs.

Version-Release number of selected component (if applicable):

# rpm -q jabberd
jabberd-2.2.4-1.fc10.i386

How reproducible:

Deterministic.

Steps to Reproduce:
1. service jabberd stop; perl -e 'open F,"service jabberd start|"; my @out=<F>; close F; print @out;'
  
Actual results:

The perl process never finishes, until you run service jabberd stop in another terminal. The service process is in a zombie meanwhile because the parent cannot reap it with waitpid because it's still blocked on that pipe read.

Expected results:

The perl process should finish just fine, with jabberd daemons running, just like (let's say) httpd.

Additional info:

Note similar issue with gpm back in Fedora Core 5, bug 208079.

Comment 1 Bernie Innocenti 2009-03-27 16:24:41 UTC
Seems an upstream bug.  Hence, forwarded it here:

  https://bugs.launchpad.net/jabberd2/+bug/349714

Comment 2 Jan Pazdziora 2009-03-30 14:22:35 UTC
Reopening.

Upstream closed this a Won't Fix.

So, we need to address this in Fedora, in our server startup scripts.

Comment 3 Bernie Innocenti 2009-03-31 09:07:04 UTC
(In reply to comment #2)
> Reopening.
> 
> Upstream closed this a Won't Fix.
> 
> So, we need to address this in Fedora, in our server startup scripts.  

The init script comes from upstream, so it's still to be fixed upstream, but I sent them a proposed patch and I'm applying it locally to our package to speed up things.

Comment 4 Bernie Innocenti 2009-03-31 09:08:02 UTC
Do we want this fix backported to F10 too?  I'd say no, it's not that critical.

Comment 5 Adrian Reber 2009-03-31 09:14:12 UTC
I not always 100% sure how easy it is to upgrade from one version of jabberd to another. That's why I tend to not upgrade jabberd during one release if it is not necessary due to security fixes.

Comment 6 Jan Pazdziora 2009-03-31 09:17:01 UTC
(In reply to comment #4)
> Do we want this fix backported to F10 too?  I'd say no, it's not that critical.  

Well, it would help us to release Spacewalk 0.5 on Fedora 10 without the hack that I've put into the Spacewalk startup code now. I can gather enough karma points for the fix if needed.

Comment 7 Jan Pazdziora 2009-03-31 09:30:13 UTC
(In reply to comment #5)
> I not always 100% sure how easy it is to upgrade from one version of jabberd to
> another. That's why I tend to not upgrade jabberd during one release if it is
> not necessary due to security fixes.  

Well, upstream did not even acknowledge it is a bug because they claim that jabberd is never run as daemon, that's why they've closed it as Won't Fix. So if we are to release a fix for Fedora 10, it will be a new rpm release of the same upstream version, and the only change will probably be that redirect to /dev/null in /etc/rc.d/init.d/jabberd. That should not break anything.

Comment 8 Adrian Reber 2009-03-31 09:38:06 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > I not always 100% sure how easy it is to upgrade from one version of jabberd to
> > another. That's why I tend to not upgrade jabberd during one release if it is
> > not necessary due to security fixes.  
> 
> Well, upstream did not even acknowledge it is a bug because they claim that
> jabberd is never run as daemon, that's why they've closed it as Won't Fix. So
> if we are to release a fix for Fedora 10, it will be a new rpm release of the
> same upstream version, and the only change will probably be that redirect to
> /dev/null in /etc/rc.d/init.d/jabberd. That should not break anything.  

That is correct. I was not thinking straight. Only fixing the start up scripts like Bernie is doing for rawhide in CVS would certainly not hurt.

Comment 9 Bernie Innocenti 2009-03-31 09:41:58 UTC
Plus, I just noticed we use a local version of the initscript after all.
Hence the fix actually goes there for us.

> That is correct. I was not thinking straight. Only fixing the start up scripts
> like Bernie is doing for rawhide in CVS would certainly not hurt.

Ok, I'm backporting it to F10 too then.

Comment 10 Bernie Innocenti 2009-03-31 10:00:32 UTC
Package in F11 built successfully in Koji.

Adrian, I have no ACLs for the F-10 branch.  Either backport yourself, or authorize me.

Comment 11 Adrian Reber 2009-03-31 10:06:27 UTC
According to pkgdb you have the necessary rights. I will backport your changes.

Comment 12 Bernie Innocenti 2009-03-31 10:16:29 UTC
(In reply to comment #11)
> According to pkgdb you have the necessary rights. I will backport your changes.  

Never mind, I had done something stupid before.  Now it worked, and it's building in Koji.

Comment 13 Adrian Reber 2009-03-31 10:23:49 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > According to pkgdb you have the necessary rights. I will backport your changes.  
> 
> Never mind, I had done something stupid before.  Now it worked, and it's
> building in Koji.  

Mine also ;-) As your version (-4) is newer than mine (-3), please push your version.

Comment 14 Bernie Innocenti 2009-03-31 10:28:38 UTC
Reopening this bug since it should be automatically closed by Bodhi when the update is pushed.

Comment 15 Fedora Update System 2009-03-31 10:29:08 UTC
jabberd-2.2.4-4.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/jabberd-2.2.4-4.fc10

Comment 16 Fedora Update System 2009-04-02 17:10:48 UTC
jabberd-2.2.4-4.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Jan Pazdziora 2009-04-02 18:21:20 UTC
Thank you, guys.


Note You need to log in before you can comment on or make changes to this bug.