New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running ejabberd through homebrew services #3343
Comments
Please redirect me if you consider this a homebrew problem rather than ejabberd related. Since homebrew is now the recommended version of installing it, I figure this is the right place. |
Hi, I think the issue is that when started as a service, ejabberd will be started with a different user and thus will use a different Erlang cookie. |
Hello, Could you check if using 'sudo ejabberdctl ' helps here? Generally you need to run that command as user that ejabberd server is using (to have permission to talk to service), but when running it as root that script will change to ejabberd user for you. I am guessing brew start service using different user than what you are using. |
Sudo doesn't help, unfortunately. I thought the same thing could have been happening.
That's ejabberd running through
However.. the
So... maybe there's really nothing running, huh?
I suspect I just don't understand the domain well enough. Happy to provide further information, just let me know how I can help :) Meanwhile, I'll try to look for more logs, maybe there really is an error message somewhere, but not exactly where we might expected it. |
That "status 4" indicates that the process was shut down:
Not a reason for the exit, but it is a start :) |
This command in using erlang interprocess communication protocol, and to make two node be able to talk to each one, they must share common cookie file, looks like calling that command through brew uses different cookie than when you are calling this directly. Probably something need to be changed in brew service startup process, or have some command that will make it use brew cookie. |
I'm unfortunately not very familiar with Erlang, and it's the first time I hear about Erlang cookies. Is there a relatively straightforward way for me to find out what the path to the cookie # cat ~/Library/LaunchAgents/homebrew.mxcl.ejabberd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/usr/local/var/lib/ejabberd</string>
</dict>
<key>Label</key>
<string>homebrew.mxcl.ejabberd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/ejabberd/sbin/ejabberdctl</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var/lib/ejabberd</string>
</dict>
</plist> The directory |
Well actually.. maybe it's not cookie related. If the service has a status of 4 (meaning it's down), it's because ejabberd isn't starting at all. Let me see if I can enable a more useful logging level to get more information out of it. |
I think your suspicions are right that this is user account related. Unfortunately I don't know how to proceed on that, but I'm happy to assist & test your ideas |
@mull In the short term, you should ensure that the content of the file |
This can be used to define the Erlang cookie in a place that feels less foreign to non Erlang users. Fixes #3343
I can confirm that the short term workaround works! I'll edit the issue for the others who might arrive here. Thank you! If you need help validating the outcome of #3346 let me know when it's ready and I'll give it a try :) |
It should be fixed when ejabberd 20.07 is released on homebrew: Homebrew/homebrew-core#58859 |
Thank you for the fix, I can confirm that it works. The only difference in our setup seems to be that the ejabberd_auth_http module comes preinstalled now, so we switched |
UPDATE
Short term workaround (from #3343 (comment)):
Environment
ejabberd: stable 20.04 (bottled), HEAD
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.7.2.2
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
Errors from error.log/crash.log
Bug description
Using
brew services start ejabberd
followed byejabberctl status
gives me the following output:I've added my hostname (
Emils-MacBook-Pro.local
) in /private/etc/hosts as described in the formula:I can run ejabberd by using
ejabberdctl
, but not through the brew services. Since homebrew seems to be the official recommendation for installation, perhaps we can figure out what's going on here and fix it (or mention it) in the formula?The documentation seems to (?) recommend using
ejabberdctl
for running the server, but when you install it from homebrew you get the impression that I can be managed by brew services. Is there a technical reason why that can't be done, or is it just a bug that we can fix?ejabberdctl live
gives a hint at the problem, possibly? It might be related to the hostname resolution... I've silenced that by settingturn_ip
to127.0.0.1
, but it doesn't seem to be helping. I just loose the warning in the live output, but the same connection problem (nodedown) appears.The text was updated successfully, but these errors were encountered: