Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523690 - net-im/ejabberd-2.1.13-r1 - ejabberdctl fails to start ejabberd under daemontools/runit
Summary: net-im/ejabberd-2.1.13-r1 - ejabberdctl fails to start ejabberd under daemont...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 10:50 UTC by Alex Efros
Modified: 2016-08-21 10:52 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2014-09-25 10:50:56 UTC
Service supervisors like daemontools or runit require service to be run in foreground, without forking to background. ejabberdctl has two options to run ejabberd: "start" (which force -detached param) and "live" (which doesn't force -detached), but right now neither is really suitable to be used with daemontools/runit.

It looks like "live" can be used to run under daemontools/runit if we add few extra params (-noinput -sasl sasl_error_logger {file,"/var/log/jabber/erlang.log"}), but there is a bug in ejabberdctl script which prevent this: while all start-functions in that script (start(), debug() and live()) internally use "$@" when run actual command to start ejabberd, they're called without any params (so "$@" is always empty). At same time logic which parse ejabberdctl params stop at "--" param, so looks like it was supposed to provide extra params to start/debug/live.

I think patch should be trivial, like:

-    ' start') start;;
-    ' debug') debug;;
-    ' live') live;;
+    ' start') start "$@";;
+    ' debug') debug "$@";;
+    ' live') live "$@";;


Just for the reference, there is also another issue - I didn't find a way to use daemontools/runit standard loggers (multilog/svlogd) for ejabberd. Usually we replace log files with fifo (so service write to fifo while thinking it write to usual log file) and run extra service(s) which read from fifo and write actual logs. But AFAIK erlang doesn't support writing to fifo so this workaround doesn't work.
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-21 10:52:10 UTC
ejabberd-2.1 has been removed from the tree (see bug 539040). Please open a new bug if it occurs in >=ejabberd-16.