Skip to content

Commit

Permalink
Fix debian postgresql service name
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
Jamal-B committed Feb 15, 2024
1 parent 68931b3 commit 46fe96e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 46fe96e

Please sign in to comment.