kigster / puma-daemon

Puma (starting version 5) removed automatic demonization from the gem itself. This functionality was extracted to this gem, which supports Puma v5 and v6.
MIT License
37 stars 6 forks source link

exit status 0 on puma start using monit #24

Open nikhilbhatt opened 1 year ago

nikhilbhatt commented 1 year ago

I am facing error (exit status 0) in latest versions of puma-daemon gem.

0.1.2 works fine without any error with puma 6.4 version. but later version of puma-daemon throws error.

rails version - 6.1.4 ruby - 2.7.2 puma - 6.4 puma-daemon - > 0.1.2

Steps to reproduce

  1. Update the gem versions to > 0.1.2
  2. start puma
  3. Error log
'puma' failed to start (exit status 0) -- '/bin/bash -l -c bin/pumactl start -F /path_to_puma_config.rb>
                                                                     [673353] * Puma version: 6.4.0 (ruby 2.7.5-p203) ("The Eagle of Durango")
                                                                     [673353] *  Min threads: 1
                                                                     [673353] *  Max threads: 1
                                                                     [673353] *  Environment: env
                                                                     [673353] *   Master PID: 12345
                                                                     [673353] *  Puma Dae

I am using monit to start the puma process.

kigster commented 10 months ago

Could you please share the relevant parts of the puma's configuration?

nikhilbhatt commented 10 months ago
#!/usr/bin/env puma

directory 'app_base_dir'
rackup 'path_to_config.ru'

environment 'current_environment'

daemonize

pidfile 'path_of_puma.pid'
state_path 'path_of_puma.state'

threads Integer(ENV['MIN_THREADS']), Integer(ENV['MAX_THREADS'])
Thread.abort_on_exception = true

bind 'unix://socket_path'

workers Integer(ENV['WEB_CONCURRENCY'])

preload_app!

tag 'app_name'

worker_timeout 20

activate_control_app 'path_to_pumactl.sock'

This is the minimal configurations set to puma.rb

Configurations were same for both the versions. I just updated out gem to newer version and it stopped working.

Note:- we are now no longer using puma-daemon gem. as suggested by puma docs we have separated out the logic of daemonization from application.

kigster commented 10 months ago

Will investigate

kigster commented 7 months ago

Could you move the daemonize to the end of the config file and retest?