summaryrefslogtreecommitdiff
path: root/system/postgresql/rc.postgresql.new
diff options
context:
space:
mode:
authorAdis Nezirovic <adis_at_linux.org.ba>2012-12-02 18:58:51 +0100
committerdsomero <xgizzmo@slackbuilds.org>2012-12-11 16:22:26 -0500
commitc064880ae9ab682d8b02e38a10b055094d0a917b (patch)
tree44103a4410b5e730609e35a05e5b3ca0aa3d531f /system/postgresql/rc.postgresql.new
parente023c00f20babdb789540db5efbaafc468165c5e (diff)
downloadslackbuilds-c064880ae9ab682d8b02e38a10b055094d0a917b.tar.gz
system/postgresql: Updated for version 9.2.1.
Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>
Diffstat (limited to 'system/postgresql/rc.postgresql.new')
-rw-r--r--system/postgresql/rc.postgresql.new12
1 files changed, 11 insertions, 1 deletions
diff --git a/system/postgresql/rc.postgresql.new b/system/postgresql/rc.postgresql.new
index 5eef25badd..6ccda6a335 100644
--- a/system/postgresql/rc.postgresql.new
+++ b/system/postgresql/rc.postgresql.new
@@ -18,6 +18,14 @@ DATADIR=/var/lib/pgsql/data
POSTGRES=/usr/bin/postgres
PIDFILE=postmaster.pid
+# oom-killer score
+# if defined and set to -1000, main postmaster wont be killed
+# by Linux OOM killer, but individual backends still could be
+# (since OOM_SCORE_ADJ in SlackBuild is set to 0)
+#
+# http://www.kernel.org/doc/Documentation/filesystems/proc.txt
+OOM_SCORE_ADJ=-1000
+
# Return values (according to LSB):
# 0 - success
# 1 - generic or unspecified error
@@ -65,6 +73,7 @@ case "$1" in
if [ ! -f $DATADIR/$PIDFILE ]; then
rm -f /tmp/.s.PGSQL.5432
rm -f /tmp/.s.PGSQL.5432.lock
+ test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
pg_ctl start -w -l $LOGFILE -D $DATADIR
exit 0
else
@@ -89,7 +98,7 @@ case "$1" in
;;
"unclean-stop")
- # Take care: This will abort server process itself
+ # Take care! This will abort server process itself
# resulting with database recovery on next start.
echo "Shutting down PostgreSQL (immediate)..."
pg_ctl stop -l $LOGFILE -D $DATADIR -m immediate
@@ -97,6 +106,7 @@ case "$1" in
"restart")
echo "Restarting PostgreSQL..."
+ test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
pg_ctl restart -l $LOGFILE -D $DATADIR -m smart
;;