service: OOM handling set compatibly with 9.5+

Thanks Tom.

Resolves: #1110969
Version: 9.3.4-7
This commit is contained in:
Pavel Raiskup 2014-06-19 18:31:18 +02:00
parent abb534ae56
commit 49f074f191
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -64,7 +64,7 @@ Summary: PostgreSQL client programs
Name: postgresql
%global majorversion 9.3
Version: 9.3.4
Release: 6%{?dist}
Release: 7%{?dist}
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
# recognizes it as an independent license, so we do as well.
@ -402,6 +402,7 @@ CFLAGS=`echo $CFLAGS | xargs -n 1 | sed 's|-O2|-O3|g' | xargs -n 100`
# Strip out -ffast-math from CFLAGS....
CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`
# Add LINUX_OOM_SCORE_ADJ=0 to ensure child processes reset postmaster's oom_score_adj
# (this define will be useless in Postgres 9.5 and later)
CFLAGS="$CFLAGS -DLINUX_OOM_SCORE_ADJ=0"
export CFLAGS
@ -1133,6 +1134,9 @@ fi
%endif
%changelog
* Thu Jun 19 2014 Pavel Raiskup <praiskup@redhat.com> - 9.3.4-7
- OOM handling compatible with 9.5+, by Tom Lane (#1110969)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.3.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild