ejabberd: is there a way to configure a different “cookie” than “ejabberd”?

谁都会走 提交于 2019-12-12 18:00:56

问题


I am building an ejabberd module. I require this module to perform RPC calls to another node on the same LAN (sname). From what I understand, ejabberd configures it owns "cookie" which, of course, will differ from the cookie I use for my other nodes.

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

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

EDIT: even when creating /home/ejabberd/.erlang.cookie (username: ejabberd, group: ejabberd) with an appropriate cookie it still does not work.

EDIT: one way to go around the problem (which isn't so nice) is to copy (with the proper permissions) the intended .erlang.cookie file to /var/lib/ejabberd


回答1:


The ejabberdctl script sets the home directory so that the cookie file lives at /var/lib/ejabberd/.erlang.cookie. Erlang itself checks the permissions of the file, so they must be correct.

You have a few options to force the use of a particular cookie:

  • Change the contents of the file - ejabberd won't alter it.
  • Change the ejabberdctl script so that it passes -setcookie 'SomeCookieValue' to erl.
  • Change ejabberdctl to set a different home directory.

The cookie file will be created if it doesn't exist, but won't be changed behind your back if it does exist. Using a common cookie is required to build ejabberd clusters or to integrate with ejabberd via erlang distribution.



来源:https://stackoverflow.com/questions/1440351/ejabberd-is-there-a-way-to-configure-a-different-cookie-than-ejabberd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!