Search code examples
ruby-on-railsapplication-server

Shut down rails server once it's been daemonized?


In Ubuntu, I can run a rails server in the background as a daemon by passing in the --daemon option;

bundle exec puma -e production -b unix:///var/run/my_app.sock --daemon

However, how do I gracefully shut this daemonized process down? It's not a simple matter of crtl + c anymore :)


Solution

  • It is better to use puma control pumactl, it processes monitor and controller.

    and then you can use it like this to stop

    bundle exec pumactl -P /var/run/puma.pid stop
    

    OR

    pumactl -C unix://var/run/my_app_pumactl.sock [status|restart|halt|stop]