Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
puma /
examples /
plugins /
[ HOME SHELL ]
Name
Size
Permission
Action
redis_stop_puma.rb
1.36
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : redis_stop_puma.rb
require 'puma/plugin' require 'redis' # How to stop Puma on Heroku # - You can't use normal methods because the dyno is not accessible # - There's no file system, no way to send signals # but ... # - You can use Redis or Memcache; any network distributed key-value # store # 1. Add this plugin to your 'lib' directory # 2. In the `puma.rb` config file add the following lines # === Plugins === # require './lib/puma/plugin/redis_stop_puma' # plugin 'redis_stop_puma' # 3. Now, when you set the redis key "puma::restart::web.1", your web.1 dyno # will restart # 4. Sniffing the Heroku logs for R14 errors is application (and configuration) # specific. I use the Logentries service, watch for the pattern and the call # a webhook back into my app to set the Redis key. YMMV # You can test this locally by setting the DYNO environment variable when # when starting puma, e.g. `DYNO=pants.1 puma` Puma::Plugin.create do def start(launcher) hostname = ENV['DYNO'] return unless hostname redis = Redis.new(url: ENV.fetch('REDIS_URL', nil)) return unless redis.ping == 'PONG' in_background do while true sleep 2 if message = redis.get("puma::restart::#{hostname}") redis.del("puma::restart::#{hostname}") $stderr.puts message launcher.stop break end end end end end
Close