baiwyc119 / lxmppd

Automatically exported from code.google.com/p/lxmppd
0 stars 0 forks source link

Reload sufficient after adding domains #483

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Usually (on other main-stream Linux Daemons) the RELOAD command will trigger a 
graceful reload of all configuration without interrupting running sessions. 
When issuing the command `prosodyctl` without any sub-commands usage 
information will be displayed. This information includes the following 
statement:

     reload
        Reload Prosody's configuration and re-open log files

However, when issuing `prosodyctl reload` new configuration seems to not be 
respected.

I am uncertain if this should be classified as bug or as feature and thus leave 
this decision to your bug-wranglers.

I would like to request:
========================
The RELOAD command should respect new configuration

By 'new' I mean configuration files that have been added to the prosody daemon 
since the last start, such as new domains in particular.

The use-case is as follows:
===========================
An automation script will pull data from a DB (in my case LDAP) and possibly 
deploy additional configuration (such as additional domains with users and 
admins) which should be loadable without having to terminate the running 
sessions of all other users of all other domains.

Original issue reported on code.google.com by ad...@it-wib.org on 23 Mar 2015 at 2:35

GoogleCodeExporter commented 9 years ago
Hi, thanks for the report!

Currently we consider this behaviour a "feature" - reloads are a very safe 
operation. This is important because reloads typically use the SIGHUP signal, 
which is also used by logrotate and typically automated to rotate logs at 
midnight. Applying new config changes at midnight (particularly ones you may 
have made earlier in the day and forgotten about) doesn't seem appealing.

When you run 'prosodyctl reload', it prints the following message:

  "Prosody log files re-opened and config file reloaded. You may need to reload modules for some changes to take effect."

This describes what happens: Prosody re-reads the config file and re-opens the 
log files. However, most modules will continue using their current 
configuration until they are reloaded. Also new hosts added to the config file 
won't automatically be activated, and removed hosts won't be deactivated.

For reloading modules, you can use any of our admin interfaces 
(mod_admin_adhoc, mod_admin_telnet, mod_admin_web, ...). Alternatively, if you 
want it to be automatic, you can use mod_reload_modules from prosody-modules: 
https://code.google.com/p/prosody-modules/wiki/mod_reload_modules

For activating hosts, it's more or less the same story - either use one of the 
admin interfaces to do it, or use mod_auto_activate_hosts from prosody-modules: 
https://code.google.com/p/prosody-modules/wiki/mod_auto_activate_hosts

Down the road, we're looking into ways to easily and reliably *apply* config 
changes, instead of just reading the new config into memory. This might be in 
the form of a command in the admin interfaces, or a new signal (SIGUSR1?) or... 
if you really want it, the ability to do this on SIGHUP also.

I hope this explanation helps :)

I'm going to close this issue as invalid, purely because the behaviour you 
described is expected and isn't a bug that we need to track. But do try those 
modules I linked to - they'll solve your issue for now, and expect to see some 
changes in Prosody's default behaviour further down the line.

Original comment by MWild1 on 23 Mar 2015 at 2:59