Giter Site home page Giter Site logo

Comments (5)

FZambia avatar FZambia commented on May 14, 2024

Hello! Centrifugo can not daemonize itself. You can use other daemonize tools such as supervisord, upstart etc. Depending on operating system and linux distribution you are using.

We are using Centos and run Centrifugo using supervisord or just built-in daemon function (init.d)

from centrifugo.

FZambia avatar FZambia commented on May 14, 2024

Helpful discussion on Reddit

from centrifugo.

aleksraiden avatar aleksraiden commented on May 14, 2024

Yea, init.d scripts awesome! Thanks!

from centrifugo.

FZambia avatar FZambia commented on May 14, 2024

You are welcome! There is also discussion in Go mailing list about program daemonization. And general opinion is let external daemon program do this.

from centrifugo.

sl4mmer avatar sl4mmer commented on May 14, 2024

@aleksraiden if you use Debian/Ubuntu here is init script

vagrant@ubuntu-14:/var/www/centrifugo$ cat /etc/init.d/centrifugo
CENTRIFUGO=centrifugo
CENTRIFUGO_ARGS="--config=/etc/centrifugo/config.json --log_file=/var/log/centrifugo.log"
PIDFILE=/var/run/centrifugo.pid
case "$1" in
  start)
    echo -n "Starting Centrifugo"
    start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $CENTRIFUGO -- $CENTRIFUGO_ARGS
    echo "."
    ;;
  stop)
    echo -n "Stopping Centrifugo"
    start-stop-daemon --stop --quiet --pidfile $PIDFILE
    echo "."
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
        echo "Usage: /etc/init.d/centrifugo {start|stop|restart}"
        exit 1
esac

exit 0


from centrifugo.

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.