Reputation: 1264
Using ejabberd in docker with ejabberd/ecs
, I need to create vhost dynamically.
docker exec -it ejabberd bin/ejabberdctl reload_config
to reload the config. According to ejabberd configuration / reload at runtime, it should add/remove vhostdocker exec -it ejabberd bin/ejabberdctl registered_vhosts
registered_vhosts
gives me the vhosts before modification.
If I docker compose down && docker compose up -d
, registered_vhosts
gives the added vhost.
ejabberd.yml
syntax, is correct.reload_config
, the log show no indication of any change.It looks like ejabberd or docker are not reporting changes made to ejabberd.yml.
ejabberd.yml
after modification:
hosts:
- a.chat.preprod.example.app
- b.chat.preprod.example.app
- c.chat.preprod.example.app
- d.chat.preprod.example.app
# <new-line-tag>
docker-compose.yml
version: '3.7'
services:
main:
image: ejabberd/ecs
container_name: ejabberd
ports:
- "5222:5222"
- "5269:5269"
- "5280:5280" # ACME Well known path
- "5443:5443"
volumes:
- ./ejabberd.yml:/home/ejabberd/conf/ejabberd.yml
- ./database:/home/ejabberd/database
Edit:
It seems like it have to do with the way I edit the script with sed
sed -i "/<new-line-tag>/i \ \ - $NEW_DOMAIN" ejabberd.yml
But after I change the file with sed
, even if I edit it with vi
, the changes are not seen.
Upvotes: 0
Views: 35
Reputation: 4120
On reload_config, the log show no indication of any change.
Right, this is normal, reload_config just returns success.
registered_vhosts gives me the vhosts before modification
The configuration changes that you make to ejabberd.yml file in the host machine are not immediately available in the hosted machine, so ejabberd doesn't have access to them. Only after a container restart your changes are available.
I can see two alternatives:
For example:
$ podman exec -it --user root ejabberd vi /home/ejabberd/conf/ejabberd.yml
$ podman exec ejabberd bin/ejabberdctl reload_config
$ podman exec ejabberd bin/ejabberdctl registered_vhosts
localhost
example.com
Upvotes: 1