ejabberd how to compile new module

谁说胖子不能爱 提交于 2019-12-19 12:22:21

问题


Here I found the code:

erlc -I ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/include -pa ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/ebin   mod_my.erl 

But it did not work?


回答1:


Here are steps to add your custom module into ejabberd

  1. put your module into ejabberd/src folder.
  2. come to ejabberd directory in terminal and run command $ sudo make
  3. it will show you that your module is compiled. Now run $ sudo make install
  4. Add your module into config file at /etc/ejabberd/ejabberd.yml
  5. restart your ejabberd and your custom module will be running.



回答2:


These are the Instructions based on Ejabberd recommendation

1) Form the folder structure like below (refer any module from -- https://github.com/processone/ejabberd-contrib).

sources

│───conf
│         └───modulename.yml
│───src
│        └───modulename.erl
│───README.txt
│───COPYING
│───modulename.spec

2) Add your module folder structure to ejabberd user home directory (check ejabberdctl.cfg for CONTRIB_MODULES_PATH param).

3) Type command ejabberdctl modules_available it will list your module

4) Type ejabberdctl module_install module_name command

For Reference https://docs.ejabberd.im/developer/extending-ejabberd/modules/




回答3:


Just drop the module in the ejabberd's src/ folder then "make". Nothing special needed to compile it.



来源:https://stackoverflow.com/questions/18202550/ejabberd-how-to-compile-new-module

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