diff options
-rw-r--r-- | postgresql.service | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/postgresql.service b/postgresql.service index aa63e1a..f390308 100644 --- a/postgresql.service +++ b/postgresql.service @@ -46,6 +46,10 @@ Environment=PGDATA=/var/lib/pgsql/data # Disable OOM kill on the postmaster OOMScoreAdjust=-1000 +# ... but allow it still to be effective for child processes +# (note that these settings are ignored by Postgres releases before 9.5) +Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj +Environment=PG_OOM_ADJUST_VALUE=0 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 |