Skip to content

Instantly share code, notes, and snippets.

@shuuuuun
Last active December 8, 2021 15:41
Show Gist options
  • Save shuuuuun/f6a57c3994f3064c5c74ed886e6a0c5b to your computer and use it in GitHub Desktop.
Save shuuuuun/f6a57c3994f3064c5c74ed886e6a0c5b to your computer and use it in GitHub Desktop.
[pumactl.rb]
#!/usr/bin/env ruby
APP_ROOT = File.expand_path "#{File.dirname(__FILE__)}/.."
pid_file = "#{APP_ROOT}/tmp/pids/app.pid"
if File.exist?(pid_file)
puts 'Found puma pid file!'
puts 'Puma may have been already started!'
exit
end
exec("#{APP_ROOT}/bin/bundle exec puma -C #{APP_ROOT}/config/puma.rb -d")
#!/usr/bin/env ruby
APP_ROOT = File.expand_path "#{File.dirname(__FILE__)}/.."
pid_file = "#{APP_ROOT}/tmp/pids/app.pid"
unless File.exist?(pid_file)
puts 'Not found puma pid file!'
exit
end
exec("kill -QUIT `cat #{pid_file}`")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment