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
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.
Created attachment 220913 [details, diff] Patch to initd, fixing the problem. Sorry, patch somehow got a messed up. Attaching split versions now.
Created attachment 220915 [details, diff] Complimentary patch to confd
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.
Should be fixed in 2.1.4.