Starting and stopping hosts

Since the last update I added a number of safeties for starting and stopping domains.  A domain has to be a valid configured domain that is not currently running before ejabberd_hosts:start_host(“hostname”) can be called.

The register_host(Host) and unregister_host(Host) functions can now be used to add or remove entries in the dynamic_hosts configuration option.  With the addition of these functions it is now possible to dynamically register, start, stop and unregister domains.  The next parts that need to be solved now are configuring a domain’s local settings.  Currently domains can be provisioned and controlled using ejabberdctl.  Below is one of my command line sessions testing out the dynamic domain provisioning features I’ve been working on.

# sbin/ejabberdctl start
# sbin/ejabberdctl status
The node ejabberd@monitor is started with status: started
ejabberd 2.1.11 is running in that node
# sbin/ejabberdctl start_host fastinfra.com
Host fastinfra.com started.
# sbin/ejabberdctl start_host fastinfra.com
Error: already_running
# sbin/ejabberdctl stop_host fastinfra.com
Host fastinfra.com stopped.
# sbin/ejabberdctl unregister_host fastinfra.com
Host fastinfra.com unregistered.
# sbin/ejabberdctl start_host fastinfra.com
Error: nohost

Now it is time to start testing with clients to see what broke as I went through making these changes.  I have done the basic tests of connecting and passing messages between users.  There is a lot more testing to be done, but the basics appear to be there.  You can test it too as all my changes are in the fork21 branch of ejabberd I have been working on.

Stay tuned for more updates.  I hope to keep these changes moving in new and interesting directions for ejabberd.

About Shaun Kruger

I am one of the co-founders of Chatmongers.com cloud XMPP service. Hacking on ejabberd provides interesting and fun challenges. When I'm not working on chat related projects I work as a systems engineer.
This entry was posted in Commits. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>