Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 306593 - net-im/ejabberd-2.0.5-r3: init script always reports status as crashed
Summary: net-im/ejabberd-2.0.5-r3: init script always reports status as crashed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Net-im project
URL:
Whiteboard:
Keywords:
Depends on: 281366
Blocks:
  Show dependency tree
 
Reported: 2010-02-24 02:45 UTC by Livid
Modified: 2010-06-21 08:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to initd and confd parts of initscript, fixing the problem. (ejabberd-2-initscripts.diff,2.17 KB, patch)
2010-02-24 02:56 UTC, Livid
Details | Diff
Patch to initd, fixing the problem. (ejabberd-2.initd.diff,751 bytes, patch)
2010-02-24 02:58 UTC, Livid
Details | Diff
Complimentary patch to confd (ejabberd-2.confd.diff,258 bytes, patch)
2010-02-24 02:59 UTC, Livid
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.