From e9ea47051a24b018098a5f0e4e0d31d94ef25d91 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 6 Dec 2022 20:24:28 +0000 Subject: [PATCH] Drop passenger cleanup script that is no longer needed --- cookbooks/web/recipes/rails.rb | 8 ++------ .../web/templates/default/passenger.cron.erb | 16 ---------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 cookbooks/web/templates/default/passenger.cron.erb diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index b28e19ba7..6265f4f30 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -42,12 +42,8 @@ end nodejs_package "svgo" -template "/etc/cron.hourly/passenger" do - cookbook "web" - source "passenger.cron.erb" - owner "root" - group "root" - mode "755" +file "/etc/cron.hourly/passenger" do + action :delete end rails_directory = "#{node[:web][:base_directory]}/rails" diff --git a/cookbooks/web/templates/default/passenger.cron.erb b/cookbooks/web/templates/default/passenger.cron.erb deleted file mode 100644 index d3cef76ee..000000000 --- a/cookbooks/web/templates/default/passenger.cron.erb +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# Get a list of rack processes that are running -pgrep -u rails -f Rack | sort > /tmp/rails.actual.$$ - -# Get a list of rack processes we expect to be running -PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> passenger-status | awk '/PID:/ { print $3 }' | sort > /tmp/rails.expected.$$ - -# Get a list of unexpected rack processes -pids=$(comm -23 /tmp/rails.actual.$$ /tmp/rails.expected.$$) - -# Kill any expected rack processes -[ -n "$pids" ] && kill -9 $pids > /dev/null 2>&1 - -# Remove our temporary files -rm -f /tmp/rails.actual.$$ /tmp/rails.expected.$$ -- 2.39.5