Ejabberd: is there a way to set a different cookie than ejabberd?

I am creating an ejabberd module. I require this module to make RPC calls to another node on the same local network (sname). From what I understand, ejabberd configures that it owns a "cookie", which will of course be different from the cookie I use for my other sites.

Is there a way to force ejabberd to use a different cookie?

EDIT: ejabberd starts its daemon under username "ejabberd".

EDIT: Even when creating /home/ejabberd/.erlang.cookie(username: ejabberd, group: ejabberd) with the corresponding cookie, it still doesn't work.

EDIT: One way to get around the problem (which is not so nice) is to copy (with appropriate permissions) the alleged .erlang.cookie file to / var / lib / ejabberd

+2


source to share


1 answer


The ejabberdctl script sets the home directory for the cookie to reside in /var/lib/ejabberd/.erlang.cookie

. Erlang itself checks the file's permissions, so they must be correct.

You have several options for enforcing a specific cookie:



  • Change the content of the file - ejabberd will not change it.
  • Modify the ejabberdctl script so that it goes -setcookie 'SomeCookieValue'

    before erl.
  • Modify ejabberdctl to set a different home directory.

The cookie will be created if it doesn't exist, but won't change behind your back if it exists. The use of a shared cookie is required to create ejabberd clusters or to integrate with ejabberd via the erlang distribution.

+4


source







All Articles