From 46fe96eea707e6a0851179f95dd96ab66dae3b6b Mon Sep 17 00:00:00 2001 From: Jamal Boukaffal Date: Thu, 7 Sep 2023 16:05:39 +0200 Subject: [PATCH] Fix debian postgresql service name As we can see below we can't rely on `postgresql.service` to propagate correctly all actions in all circumstances to `postgresql@.service`. It's perhaps due to the fact that `postgresql.service` is configured with (see `systemctl cat postgresql.service` for more details): ``` [Service] Type=oneshot ExecStart=/bin/true ExecReload=/bin/true RemainAfterExit=on ``` So it's safer to target explicitely the final service name (e.g.:`postgresql@15-main.service`). Case not OK: ``` systemctl is-active postgresql.service active systemctl is-active postgresql@15-main.service active systemctl stop postgresql@15-main.service systemctl is-active postgresql@15-main.service inactive systemctl is-active postgresql.service active ``` Case OK: ``` systemctl start postgresql@15-main.service systemctl is-active postgresql@15-main.service active systemctl is-active postgresql.service active systemctl stop postgresql.service systemctl is-active postgresql.service inactive systemctl is-active postgresql@15-main.service inactive ``` --- vars/Debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/Debian.yml b/vars/Debian.yml index a57a36d2..24ae28f5 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,7 +1,7 @@ --- # PostgreSQL vars for Debian based distributions -postgresql_service_name: "postgresql" +postgresql_service_name: "postgresql@{{ postgresql_version }}-{{ postgresql_cluster_name }}" postgresql_bin_directory: /usr/bin