summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Tennis <caleb@gentoo.org>2009-04-27 13:33:32 +0000
committerCaleb Tennis <caleb@gentoo.org>2009-04-27 13:33:32 +0000
commitd1b8a2f0c80263b76e57369653587f27eb5c4045 (patch)
tree5143fa669ebe84fe8a04f296e6f820e232475675 /net-im/ejabberd/files
parentStable for HPPA (bug #260063). (diff)
downloadgentoo-2-d1b8a2f0c80263b76e57369653587f27eb5c4045.tar.gz
gentoo-2-d1b8a2f0c80263b76e57369653587f27eb5c4045.tar.bz2
gentoo-2-d1b8a2f0c80263b76e57369653587f27eb5c4045.zip
Bump adding a new debug shell patch to the wrapper, from bug #250861
(Portage version: 2.1.6.11/cvs/Linux i686)
Diffstat (limited to 'net-im/ejabberd/files')
-rw-r--r--net-im/ejabberd/files/ejabberdctl-wrapper-3.template46
1 files changed, 46 insertions, 0 deletions
diff --git a/net-im/ejabberd/files/ejabberdctl-wrapper-3.template b/net-im/ejabberd/files/ejabberdctl-wrapper-3.template
new file mode 100644
index 000000000000..05b67d8bca4b
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberdctl-wrapper-3.template
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+[ -f /etc/conf.d/ejabberd ] && . /etc/conf.d/ejabberd
+
+if [ -r /var/run/jabber/.erlang.cookie ] ; then
+ HOME=/var/run/jabber
+ export HOME
+fi
+
+ERL=/usr/bin/erl
+
+if [ $# -ne 0 ] ; then
+ case $1 in
+ --node) shift ; EJABBERD_NODE=$1 ; shift ;;
+ esac
+fi
+
+if [ "$EJABBERD_NODE" = "${EJABBERD_NODE%.*}" ] ; then
+ SNAME=-sname
+else
+ SNAME=-name
+fi
+
+case $1 in
+ debug)
+ shift
+
+ if [ "$EJABBERD_NODE" = "${EJABBERD_NODE%@*}" ] ; then
+ EJABBERD_NODE=$EJABBERD_NODE@$(hostname -s)
+ fi
+
+ echo "Attaching Erlang shell to node $EJABBERD_NODE."
+ echo "To detach it, press: Ctrl+G, q, Return"
+ echo ""
+ exec $ERL $SNAME ejabberddebug \
+ -remsh $EJABBERD_NODE \
+ "$@"
+ ;;
+ *)
+exec $ERL $SNAME ejabberdctl \
+ -pa /usr/@libdir@/erlang/lib/ejabberd-@version@/ebin \
+ -s ejabberd_ctl \
+ -noinput \
+ -extra $EJABBERD_NODE "$@"
+ ;;
+esac