I was wonderng if anyone knows of a way to get into Mochiweb like ejabberd does when you run /sbin/ejabberdctl debug?
+2
A:
- 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.
gleber
2009-11-30 11:35:51
Awesome, thanks! It didn't work at first b/c I had to also -setcookie to match, but it worked after that. Thanks a lot
ewindsor
2009-11-30 21:06:17
Good point about the cookie. I'm using cookie from `~/.erlang.cookie` file so forgot about `-setcookie` thing :)
gleber
2009-12-01 10:37:23
I've updated my answer to include bits about cookie
gleber
2009-12-01 10:39:47