I was wonderng if anyone knows of a way to get into Mochiweb like ejabberd does when you run /sbin/ejabberdctl debug?
-sname $NODE@$HOST
(or -name $NODE@$FULLHOST
) is present in parameters of erl
call in start.sh
of your mochiweb-based projectCreate file debug.sh
with the following code:
#!/bin/bash
erl -sname debug_$NODE@$HOST -remsh $NODE@$HOST
Make sure not to mix sname
and name
in scripts, because nodes with short names can not communicate with nodes with full names (and vice versa). Additionally make sure to use the same cookie on both nodes either via -setcookie
parameter of erl
or via ~/.erlang.cookie
file.
Of course you have to replace $NODE, $HOST and $FULLHOST with appropriate values.