# ejabberd startup problem



## time4e (Jul 28, 2012)

I have install port net-im/ejabberd and configured it accordingly. The messaging works great between users. I have added ejabberd_enable="YES" to my /etc/rc.conf. When the system is restarted I have to manually run 
	
	



```
service ejabberd start
```
 and 
	
	



```
/usr/local/sbin/ejabberdctl start
```
 in order to start *ejabberd*. What is the best way to configure *ejabberd* on boot?


FreeBSD 9
Ejabberd 2.1.11 

Thanks,
-Tim


----------



## shitson (Jul 28, 2012)

Have you checked the logs? Is it actually start on boot, maybe it's failing to start because of configuration...


----------



## time4e (Jul 31, 2012)

What log files should I check?

Thanks


----------



## time4e (Nov 3, 2012)

I removed the ejabberd package and install /usr/ports/net-im/openfire. It works great!


----------



## aragats (Dec 7, 2016)

This is a really old thread, but the problem still exists in 11-RELEASE.
The net-im/ejabberd daemon scripts tries to start it as user _ejabberd_, which doesn't work for some reason. Running manually as root:
	
	



```
# ejabberdctl start
```
works. This is not a solution, of course...


----------



## aragats (Dec 7, 2016)

The root cause of the problem is wrong ownership of the files in /var/spool/ejabberd/. Those files must be owned by user _ejabberd_. 
That happens when you start/stop ejabberd as root, e.g. in my case I've done it multiple times at the beginning - playing with the configuration and testing this or that.


----------



## ChrisBSD (Oct 7, 2017)

aragats

I've been struggling to get this ejabberd up and running. There's such a lack of info. Did you happen to follow a how to you can share? I'm days into this and not sure why. Not an expert here...


----------



## aragats (Oct 9, 2017)

ChrisBSD , I really don't remember those one-year-old details. There were some confusing things to me too. Also, they switched to .yml format, I never had problems with the old way.
Anyway, here attached is my ejabberd.yml. Actually I didn't change much from there example. I have it configured for 2 domains, so you'll see repeating lines in a couple of places.
(I had to add .txt to upload it here)


----------

