25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Added support for Jot in ctl and TTY in debug (thanks to Jan Koum)

This commit is contained in:
Badlop 2010-02-12 20:50:56 +01:00
parent 60ffcd78f1
commit cab98b3fd5

View File

@ -169,8 +169,9 @@ debug ()
read foo read foo
fi fi
echo "" echo ""
TTY=`tty | cut -f4 -d'/'`
$EXEC_CMD "$ERL \ $EXEC_CMD "$ERL \
$NAME debug-${ERLANG_NODE} \ $NAME debug-${TTY}-${ERLANG_NODE} \
-remsh $ERLANG_NODE \ -remsh $ERLANG_NODE \
-hidden \ -hidden \
$ERLANG_OPTS $ARGS \"$@\"" $ERLANG_OPTS $ARGS \"$@\""
@ -236,14 +237,19 @@ ctl ()
CONNLOCKDIR=@LOCALSTATEDIR@/lock/ejabberdctl CONNLOCKDIR=@LOCALSTATEDIR@/lock/ejabberdctl
FLOCK='/usr/bin/flock' FLOCK='/usr/bin/flock'
if [ ! -x "$FLOCK" ] ; then if [ ! -x "$FLOCK" ] ; then
FLOCK="" JOT='/usr/bin/jot'
fi if [ ! -x "$JOT" ] ; then
# no flock or jot, simply invoke ctlexec()
if [ ! "$FLOCK" ] ; then CTL_CONN="ctl-${ERLANG_NODE}"
# no flock, simply invoke ctlexec() ctlexec $CTL_CONN $COMMAND
CTL_CONN="ctl-${ERLANG_NODE}" result=$?
ctlexec $CTL_CONN $COMMAND else
result=$? # no flock, but at least there is jot
RAND=`jot -r 1 0 $MAXCONNID`
CTL_CONN="ctl-${RAND}-${ERLANG_NODE}"
ctlexec $CTL_CONN $COMMAND
result=$?
fi
else else
# we have flock so we get a lock # we have flock so we get a lock
# on one of a limited number of # on one of a limited number of