yum install ejabberd Configurationįirst, we have to setup the administrative user. Then, run the following command to install it. In Ubuntu, we can install it using command: sudo apt-get install ejabberd On CentOS 7: Both, Web and Commandline administration Īs I mentioned above, ejabberd is available in many distributions.Multiple Jabber domains can be hosted on the same ejabberd instance.Several distributions have eJabberd in their default repositories
No need to add external software repositories.Encryption of Server and Client communication.supports all XMPP Core 1.0 and XMPP IM 1.0.ejabberd has a built-in database and web server There is no need of external database or web server.There is no need of expensive hardwares.Can run on multiple systems, and all machines will run the same Jabber domain(s).
Multi-platform – Runs under Linux, Mac OS X, BSD, and Windows.
Using eJabberd, we can easily setup an instant messaging server in minutes. Good took me hours & hours to wade through all of this.Ejabberd is a free, Open Source Jabber/XMPP instant messaging server, written in Erlang/OTP. delete the contents of /var/lock/ejabberdctl and make sure the directory is writable by user ejabberd chown the contents of /var/log/ejabberd to ejabberd:ejabberdĤ. If you modify the service, be sure to execute "systemctl daemon-reload" afterwards.ģ. Either modify /usr/lib/systemd/system/rvice to run the service as root, or remove /var/lib/ejabberd and create a new, blank directory of the same name and chown it to ejabberd:ejabberd. #!/usr/bin/pkexec /bin/sh needs to be #!/bin/shĢ. modify /usr/bin/ejabberdctl to modify it to use /bin/sh instead of /usr/bin/pkexec:
So, the summary of how to get ejabberd to run as a service on CentOS 7 (and perhaps all systemd-based linuxes:ġ. modifying /etc/sudoers to allow this to proceed fixed this problem. sudo -u ejabberd ejabberdctl fixed that for the command line, but I had scripts that were executing as root that needed to call ejabberdctl to register users.that got me some warnings from sudo about needing a tty connection. Removing all of these files helped.įinally I had an issue with ejabberdctl running from the command line as root not being able to connect to the ejabberd process that was running as ejabberd:ejabberd. I also had some issues with the lock files in /var/lock/ejabberdctl. The next issue was with access permissions to ejabberd log files. You can configure some of them with the file ejabberdctl.cfg, which includes detailed description about them. The ejabberdctl administration script uses many of those possibilities.
This system is configured using environment variables and command line parameters.
In the end I just nuked the entire directory and re-created a blank /usr/lib/ejabberd and chown'ed the entire thing to ejabberd:ejabberd. ejabberd is an Erlang/OTP application that runs inside an Erlang runtime system. chown'ing them to ejabberd:ejabberd fixed the access problem but then mnesia complained about changes in names or some such. I had been running ejabberdctl from the command line during installation and configuration, which resulted in a /var/lib/ejabberd that was owned by root:root, so when systemd ran ejabberdctl as ejabberd:ejabberd, mnesia had no access to its files. Install ejabberd on centos7 Raw install-ejabberd.sh bin bash This script installs a ejabberd on centos7 echo 'Updating packages. This change worked, and ejabberdctl started running successfully when systemd called it. chown'ing them to ejabberd:ejabberd fixed the access problem but then mnesia complained about. Rather than try to get the systemd maintainers to change this, or the pkexec maintainers to fix their issue with double forking, I tried modifying the ejabberdctl script to call for /bin/sh instead of /usr/bin/pkexec. I had been running ejabberdctl from the command line during installation and configuration, which resulted in a /var/lib/ejabberd that was owned by root:root, so when systemd ran ejabberdctl as ejabberd:ejabberd, mnesia had no access to its files. I appears that pkexec does not like being launched as part of a double fork exec, and that systemd does exactly this. After finding a cryptic log message about "refusing to render service to dead parents," I finally traced the problem to pkexec. The root problem is that it appears that systemd and pkexec do not play nice together. After spending several hours banging my head on the problem, I finally succeeded. I have seen a few discussions of problems getting ejabberd to run as a service but no conclusive explanation of how to do it.