Mochiweb debug (like ejabberd debug)
Question
I was wonderng if anyone knows of a way to get into Mochiweb like ejabberd does when you run /sbin/ejabberdctl debug?
Solution
- Make sure that
-sname $NODE@$HOST
(or-name $NODE@$FULLHOST
) is present in parameters oferl
call instart.sh
of your mochiweb-based project Create 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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow