Cannot start ejabberd 0.9.0

I'm going to use ejabberd under FreeBSD in my organization. Some time ago I've succesfully installed from ports and ran version 0.7.5, then upgraded to 0.9.0 (but! I didn't stop old ejabberd before upgrading). After upgrade I didn't change config file. Now I just cannot start the server:
=============================================================
myserv:pb#55/12:25>su ejabberd -c "/usr/local/bin/ejabberdctl ejabberd@myserv status"
{error_logger,{{2005,5,24},{12,57,53}},'Failed to create cookie file',[]}
.................................................
{"Kernel pid terminated",application_controller,shutdown}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) (shutdown)
==============================================================

What's wrong? There is file /var/run/ejabberd/.erlang.cookie:

-rw------- 1 ejabberd ejabberd 20 24 May 00:00 .erlang.cookie

It seems the user that runs

It seems the user that runs ejabberdctl cannot create the file.

  • Does that script (ejabberctl) know the cookie file name? You can specify the full location, or even the cookie itself as an argument. Example: erl -setcookie ERERERERAAAA324234
  • Does that user have a $HOME?

myserv:p3#61/10:46>finger

myserv:p3#61/10:46>finger ejabberd
Login: ejabberd Name: ejabberd pseudo user
Directory: /var/run/ejabberd Shell: /bin/sh
Never logged in.

I've specified -setcookie, it doesn't help, it says:
Can't get node ejabberd@asbase status: nodedown

Any other ideas?

now check the node name and cookie content

I've specified -setcookie, it doesn't help, it says: Can't get node ejabberd@asbase status: nodedown

It DOES help: you don't receive the same error than before.

So your new error deals with the node name (it may not be 'ejabberd@asbase') or with the cookie (it must be the same on the ejabberd server and on ejabberdctl).

But let me ask you: what's exactly your problem? You don't need ejabberdctl to start the server, right? Why are you interested in ejabberdctl?

Cannot start ejabberd 0.9.0

My problem is written in subject. You're right, I don't need ejabberdctl at all. I'll be glad to never know that it exists.
In FreeBSD there's starting script called /usr/local/etc/rc.d/ejabberd.sh. At the start of this script it's calling ejabberdctl to determine status of ... I don't know of what, 'cause I don't know erlang at all. If ejabberdctl returns not 0, then ejabberd.sh tries to start ejabberd. But in my case it returns 0, and ejabberd.sh says:
Starting ejabberd: already running.

That is why I'm asking about ejabberdctl.
I've wrote node name correctly, in script it's ejabberd@`hostname -s`, I've checked (it worked on 0.7.5).
I tried to put -setcookie in /usr/local/bin/ejabberd and /usr/local/bin/ejabberdctl, but no effect.
But! when I tried to run
su ejabberd -c "/usr/local/bin/ejabberd -noshell -detached"
ejabberd started! Still I cannot shutdown it correctly ('cause ejabberd.sh calls ejabberdctl for this task). How can I manage ejabberdctl to work correctly?

At the start of this script

At the start of this script it's calling ejabberdctl to determine status of ... I don't know of what

Probably ejabberd.sh uses ejabberdctl to check that ejabberd is not running before starting it. And even if you tweak ejabberd.sh to not check server status on startup, you are right when you say that ejabberdctl is required to stop it. So let's try to solve the problem the right way :)

Since there are no changes on ejabberd 0.7.5 -> 0.9.1 on this subject, this may be a problem in the FreeBSD package. Anyway, once you finally solve it, please tell us what was the reason.

From my experience, reasons for ejabberdctl to not connect to ejabberd (you already checked some of them):

  • the cookie in ejabberdctl and ejabberd is not the same. You can make sure they are the same using the same '-setcookie AAAA' when starting both ejabberd and ejabberdctl.
  • the node name is not correct. The node name is indicated on the ejabberd log at startup; it says 'application: ejabberd; started_at: ejabberd2@localhost'.
  • ejabberd and ejabberdctl are not started with the same -name/-sname command line option. Use -name on both, or -sname on both, but do not mix them.
  • the system user that started ejabberd and ejabberdctl is not the same. I'm not completely sure this is a problem, but it's worth the try.
  • check if any message appears on the ejabberd logs when you try ejabberdctl. You can even start ejabberd without '-detached', so you will read all the debug messages on the window (to stop ejabberd in this mode, type 'q().' ).

Cannot start ejabberd 0.9.0

I've made tests that you proposed:
-the cookies in ejabberdctl and ejabberd are the same (even more, it's equal to the one in ~ejabberd/.erlang_cookie);
-the node name is correct;
-ejabberd starts erl with -sname ejabberd, and ejabberdctl starts erl with -sname ejabberdctl (no -name in both);
-system user is the same for ejabberd and ejabberdctl;
-ejabberdctl writes nothing to log files, ejabberd when tweaked writes in sasl.log:

=INFO REPORT==== 2005-05-31 11:50:33 ===
I(<0.212.0>:ejabberd_listener:90): (#Port<0.288>) Accepted connection {{127,0,0,1},53273} -> {{127,0,0,1},5555}

P.S. I've changed -sname to ejabberd in file ejabberdctl. Now I can start ejabberd (in process table appears a process), but ejabberdctl status gives me:
Node ejabberd@myserv is starting. Status: started
I get this line when process is running. But if there are no such process, ejabberdctl starts it and says the same! "Ejabberdctl stop" does nothing at all (no messages on console and no stopping server process).

This is what I get with

This is what I get with ejabberd 0.9.1 and Erlang/OTP R10B-5. 'adeja.sh' is a little script that just calls erl, ejabberdctl, etc:

$ ./adeja.sh ctl status
Can't get node ejabberd2@localhost status: nodedown
$ ./adeja.sh start
Starting Ejabberd: ejabberd2@localhost.
$ ./adeja.sh ctl status
Node ejabberd2@localhost is started. Status: started

On 'sasl.log':

...
=PROGRESS REPORT==== 31-May-2005::17:17:58 ===
         application: ejabberd
          started_at: ejabberd2@localhost

Things to check:

  • The proccess you say that appears when you start ejabberd: is it 'beam' and consumes between 10 and 20 MB of memory, or is just 'epmd' with 2 MB of memory?
  • Once you start ejabberd, does the PROGRESS REPORT messages in sasl.log end with that last lines ('started_at: *@*')?
  • ejabberdctl status says 'starting' to you, and 'started' to me. Strange. Does ejabberd work correctly for everything else (listening on 5222 and 5269, accepting XMPP connections...)?

Cannot start ejabberd 0.9.0

-The process that appears is epmd, it consumes 1,5 MB;
-When I try to run "ejabberd.sh start" no message appears in sasl.log and no message in ejabberd.log;
-No, ejabberd doesn't work correctly for everything else, it just listens on tcp port 4369.
By the way, I'm using 0.9.0, maybe I should upgrade to 0.9.1?

epmd is a little program

epmd is a little program that is automatically started with Erlang. You are not starting ejabberd correctly, or something prevents ejabberd from starting correctly.

Cannot start ejabberd 0.9.0

So, as I see, nothing could be done. Ok, I'm giving up with ejabberd, gonna try jabberd2.

Syndicate content