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 diff --git a/postgresql.spec b/postgresql.spec index 1db55b8..4c46edc 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -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 - 9.3.4-7 +- OOM handling compatible with 9.5+, by Tom Lane (#1110969) + * Sat Jun 07 2014 Fedora Release Engineering - 9.3.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild