Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 306593

Summary: net-im/ejabberd-2.0.5-r3: init script always reports status as crashed
Product: Gentoo Linux Reporter: Livid <g.livid>
Component: Current packagesAssignee: Gentoo Net-im project <net-im>
Status: RESOLVED FIXED    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 281366    
Bug Blocks:    
Attachments: Patch to initd and confd parts of initscript, fixing the problem.
Patch to initd, fixing the problem.
Complimentary patch to confd

Description Livid 2010-02-24 02:45:06 UTC
Running
/etc/init.d/ejabberd status
when service is running always reports status as crashed.

Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/ejabberd start
2. /etc/init.d/ejabberd status
3. Read the output

Actual Results:  
# /etc/init.d/ejabberd status
 * status: crashed

Expected Results:  
# /etc/init.d/ejabberd status
 * status: started
Comment 1 Livid 2010-02-24 02:56:34 UTC
Created attachment 220909 [details, diff]
Patch to initd and confd parts of initscript, fixing the problem.

There is actually a reason behind this behavior. Put it simply, ejabberd run in detached mode does not create pidfile, nor does it report its pid with any other means. Openrc, finding no pidfile, concludes that daemon is crashed and thus reports it as such.
I'm attaching a simple (and sort of ugly) patch which also fixes 'restart' command (which does not work since 'ejabberdctl stop' does not kill daemon immediately) I am not sure it's the right way to fix the problem described above, but it works for me.
Obviously, 'start-stop-daemon --name' is redundant, but I left it there for the sake of clarity.
Comment 2 Livid 2010-02-24 02:58:49 UTC
Created attachment 220913 [details, diff]
Patch to initd, fixing the problem.

Sorry, patch somehow got a messed up. Attaching split versions now.
Comment 3 Livid 2010-02-24 02:59:26 UTC
Created attachment 220915 [details, diff]
Complimentary patch to confd
Comment 4 Peter Volkov (RETIRED) gentoo-dev 2010-05-26 20:09:44 UTC
Thank you for report. In ejabberd-2.1.3 (which is now available in the tree) I've cleaned init script a lot so I hope this bug will be fixed there. Keeping this bug open until ejabberd-2.1.3 enters ~arch.
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2010-06-21 08:01:41 UTC
Should be fixed in 2.1.4.