Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. # /etc/init/puma.conf - Puma config
  2.  
  3. # This example config should work with Ubuntu 12.04+. It
  4. # allows you to manage multiple Puma instances with
  5. # Upstart, Ubuntu's native service management tool.
  6. #
  7. # See puma-manager.conf for how to manage all Puma instances at once.
  8. #
  9. # Save this config as /etc/init/puma.conf then manage puma with:
  10. # sudo start puma app=PATH_TO_APP
  11. # sudo stop puma app=PATH_TO_APP
  12. # sudo status puma app=PATH_TO_APP
  13. #
  14. # or use the service command:
  15. # sudo service puma {start,stop,restart,status}
  16. #
  17.  
  18. description "Puma Background Worker"
  19.  
  20. # no "start on", we don't want to automatically start
  21. stop on (stopping puma-manager or runlevel [06])
  22.  
  23. # change apps to match your deployment user if you want to use this as a less privileged user (recommended!)
  24. setuid apps
  25. setgid apps
  26.  
  27. respawn
  28. respawn limit 3 30
  29.  
  30. instance ${app}
  31.  
  32. script
  33. # this script runs in /bin/sh by default
  34. # respawn as bash so we can source in rbenv/rvm
  35. # quoted heredoc to tell /bin/sh not to interpret
  36. # variables
  37.  
  38. # source ENV variables manually as Upstart doesn't, eg:
  39. #. /etc/environment
  40.  
  41. exec /bin/bash <<'EOT'
  42. # set HOME to the setuid user's home, there doesn't seem to be a better, portable way
  43. export HOME="$(eval echo ~$(id -un))"
  44.  
  45. if [ -d "/usr/local/rbenv/bin" ]; then
  46. export PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH"
  47. elif [ -d "$HOME/.rbenv/bin" ]; then
  48. export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
  49. elif [ -f /etc/profile.d/rvm.sh ]; then
  50. source /etc/profile.d/rvm.sh
  51. elif [ -f /usr/local/rvm/scripts/rvm ]; then
  52. source /etc/profile.d/rvm.sh
  53. elif [ -f "$HOME/.rvm/scripts/rvm" ]; then
  54. source "$HOME/.rvm/scripts/rvm"
  55. elif [ -f /usr/local/share/chruby/chruby.sh ]; then
  56. source /usr/local/share/chruby/chruby.sh
  57. if [ -f /usr/local/share/chruby/auto.sh ]; then
  58. source /usr/local/share/chruby/auto.sh
  59. fi
  60. # if you aren't using auto, set your version here
  61. # chruby 2.0.0
  62. fi
  63.  
  64. cd $app
  65. logger -t puma "Starting server: $app"
  66.  
  67. exec bundle exec puma -C config/puma.rb
  68. EOT
  69. end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement