This weekend I decided to try making some changes to ejabberd 2.1.x. I’ve gotten into ejabberd’s internals with Chatmongers and have found a number of things that I didn’t like.
The first thing I decided to go after is how hosts are started and stopped. This weekend I made some significant changes to how vhosts are started and stopped. I added a new process that manages the starting and stopping of domains in the system instead of various modules doing their own independent startup and it all starts with a supervisor.
Unfortunately, this new method of starting and stopping domains is not yet complete. I can halt a domain and start it again which stops all the modules and unregisters all of the routes then start and register again. These are useful operations, but will be even more useful if I can add dynamic vhost configuration. There is a mess that is config and local_config. I’ve stumbled my way though bugs that are related to one being cluster global and the other being node local. I already had to kludge my way around the mess when fixing dynamic host start/stop in clustered ejabberd3. Often times it doesn’t make sense why things are in local_config instead of config.
My goal is to move more things into the cluster global config from local_config. I then can add node local configuration directives. What I am hoping for in the end is a better centralized configuration for vhosts and modules while still allowing per node configuration for database connections and other node local values.
As a project ejabberd really is exciting to me. However, there have been some things that I really have not liked about it. My hope is to fix everything that has bothered me in my last few years of working with it. I’m not sure if anyone else will like my changes, but I hope to smooth some of the rough edges that bother me.