Giter Site home page Giter Site logo

Comments (7)

rroemhild avatar rroemhild commented on August 17, 2024

Give ejabberd time to start before register administrator(s).

case "$@" in
    start)
        [...]
        exec ${EJABBERDCTL} "live" &
        child=$!
        sleep 3
        ${EJABBERDCTL} register admin example.de password1234
        wait $child

from docker-ejabberd.

dirkmoors avatar dirkmoors commented on August 17, 2024

That seems to have worked, thanks!

from docker-ejabberd.

dirkmoors avatar dirkmoors commented on August 17, 2024

I was a bit too quick there. This solution works when running the docker with:

docker run -i -t rroemhild/docker-ejabberd

The problem is, when I try to do 'docker start CONTAINER_ID' afterwards, it crashes right away.

Do you know what's going on?

from docker-ejabberd.

rroemhild avatar rroemhild commented on August 17, 2024

In the second line from the run script set -e immediately exit the script on errors. ejabberdctl register returns an error on docker start because the admin user is already registered. To test this you can comment in line 2 and re-build the image. I would prefer a function that test if the container is provisioned and then skip register the admin user(s).

from docker-ejabberd.

dirkmoors avatar dirkmoors commented on August 17, 2024

Yeah commenting out 'set -e' fixed my problem. Maybe create a feature request for adding provisioning of a 'superuser' during build/deploy time?

from docker-ejabberd.

rroemhild avatar rroemhild commented on August 17, 2024

My idea for this is to split the run script into multiple pre- and post- run scripts. With this solution you can extend this image with a script that i.e. register admin users or as in #24 setup a cluster.

I pushed a preview to the split-run-script branch and add a sample script 20_ejabberd_register_admin.sh to scripts/post. To enable pre/post scripts they need an x flag. Run chmod +x 20_ejabberd_register_admin.sh and build the image.

from docker-ejabberd.

dirkmoors avatar dirkmoors commented on August 17, 2024

That looks very nice, I'll give it a go asap!

from docker-ejabberd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.