forked from evolix/ansible-roles
postgresql: Fix postgresql@.service customization
This commit is contained in:
parent
024d30ea43
commit
1576375417
5
postgresql/files/postgresql.service.override.conf
Normal file
5
postgresql/files/postgresql.service.override.conf
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Service]
|
||||||
|
OOMScoreAdjust=-1000
|
||||||
|
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
|
||||||
|
Environment=PG_MASTER_OOM_SCORE_ADJ=-1000
|
||||||
|
Environment=PG_CHILD_OOM_SCORE_ADJ=0
|
|
@ -1,8 +1,14 @@
|
||||||
---
|
---
|
||||||
|
- name: Ensure /etc/systemd/system/postgresql.service.d exists
|
||||||
|
file:
|
||||||
|
path: /etc/systemd/system/postgresql@.service.d
|
||||||
|
state: directory
|
||||||
|
recurse: true
|
||||||
|
|
||||||
- name: Override PostgreSQL systemd unit
|
- name: Override PostgreSQL systemd unit
|
||||||
template:
|
copy:
|
||||||
src: postgresql.service.j2
|
src: postgresql.service.override.conf
|
||||||
dest: /etc/systemd/system/multi-user.target.wants/postgresql.service
|
dest: /etc/systemd/system/postgresql@.service.d/override.conf
|
||||||
force: yes
|
force: yes
|
||||||
notify:
|
notify:
|
||||||
- reload systemd
|
- reload systemd
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
# systemd service for managing all PostgreSQL clusters on the system. This
|
|
||||||
# service is actually a systemd target, but we are using a service since
|
|
||||||
# targets cannot be reloaded.
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=PostgreSQL RDBMS
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
OOMScoreAdjust=-1000
|
|
||||||
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
|
|
||||||
Environment=PG_MASTER_OOM_SCORE_ADJ=-1000
|
|
||||||
Environment=PG_CHILD_OOM_SCORE_ADJ=0
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/bin/true
|
|
||||||
ExecReload=/bin/true
|
|
||||||
RemainAfterExit=on
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
Loading…
Reference in a new issue