From eb978375f4c222707d5b856412c5759c2d595050 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 17 Mar 2021 13:12:14 +0000 Subject: [PATCH] adds: simpler approach to Postgres pids --- attributes/default.rb | 3 --- templates/default/postgres.conf.erb | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 attributes/default.rb diff --git a/attributes/default.rb b/attributes/default.rb deleted file mode 100644 index 6d85577..0000000 --- a/attributes/default.rb +++ /dev/null @@ -1,3 +0,0 @@ -default['monit_configs-tlq']['postgres']['pidfile'] = '/var/run/postgresql/9.3-main.pid' -# for the community cookbook use '/var/lib/mongo/mongod.lock' -default['monit_configs-tlq']['mongo']['pidfile'] = '/var/run/mongo/mongo.pid' diff --git a/templates/default/postgres.conf.erb b/templates/default/postgres.conf.erb index 8aa9b05..f8d3553 100644 --- a/templates/default/postgres.conf.erb +++ b/templates/default/postgres.conf.erb @@ -1,8 +1,8 @@ #Monitoring Postgres Service -check process postgresql with pidfile <%= node['monit_configs-tlq']['postgres']['pidfile'] %> - start program = "/usr/bin/systemctl start postgresql" - stop program = "/usr/bin/systemctl stop postgresql" +check process postgresql with pidfile /var/run/postgresql/<%= node['postgresql']['version'] %>-main.pid + start program = "/usr/bin/systemctl start postgresql@<%= node['postgresql']['version'] %>-main" + stop program = "/usr/bin/systemctl stop postgresql@<%= node['postgresql']['version'] %>-main" if 15 restarts within 15 cycles then timeout if failed host localhost port 5432 type TCP then restart if failed host localhost port 5432 type TCP then alert