From 6091e2287010fcd494f76781633f0d413f79ea90 Mon Sep 17 00:00:00 2001 From: wrobell Date: Wed, 19 Jan 2005 08:41:37 +0000 Subject: [PATCH] - merged from DEVEL Changed files: postgresql-conf.patch -> 1.3 postgresql-ecpg_link.patch -> 1.3 postgresql.init -> 1.60 --- postgresql-conf.patch | 34 +++++++++++++++++++++------------- postgresql-ecpg_link.patch | 14 +++++++------- postgresql.init | 11 +++++++---- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/postgresql-conf.patch b/postgresql-conf.patch index edfbb18..673f543 100644 --- a/postgresql-conf.patch +++ b/postgresql-conf.patch @@ -1,27 +1,35 @@ ---- postgresql-7.4beta1/src/backend/utils/misc/postgresql.conf.sample 2003-08-08 22:41:16.000000000 +0200 -+++ postgresql-7.4beta1/src/backend/utils/misc/postgresql.conf.sample.new 2003-08-08 22:40:08.000000000 +0200 -@@ -137,9 +137,9 @@ +--- postgresql-8.0.0beta2/src/backend/utils/misc/postgresql.conf.sample 2004-08-12 21:03:36.000000000 +0200 ++++ postgresql-8.0.0beta2/src/backend/utils/misc/postgresql.conf.sample.new 2004-09-05 20:54:31.087203264 +0200 +@@ -164,7 +164,7 @@ - # - Syslog - + # - Where to Log - --#syslog = 0 # range 0-2; 0=stdout; 1=both; 2=syslog +-#log_destination = 'stderr' # Valid values are combinations of stderr, ++log_destination = 'syslog' # Valid values are combinations of stderr, + # syslog and eventlog, depending on + # platform. + +@@ -180,8 +180,8 @@ + # so many kilobytes of log output. 0 to disable. + + # These are relevant when logging to syslog: -#syslog_facility = 'LOCAL0' -#syslog_ident = 'postgres' -+syslog = 2 # range 0-2; 0=stdout; 1=both; 2=syslog +syslog_facility = 'LOCAL0' +syslog_ident = 'postgres' - # - When to Log - -@@ -170,9 +170,9 @@ + # - When to Log - +@@ -211,10 +211,10 @@ #debug_print_rewritten = false #debug_print_plan = false #debug_pretty_print = false -#log_connections = false +log_connections = true + #log_disconnections = false #log_duration = false --#log_pid = false -+log_pid = true - #log_statement = false - #log_timestamp = false - #log_hostname = false +-#log_line_prefix = '' # e.g. '<%u%%%d> ' ++log_line_prefix = '<%p> ' # e.g. '<%u%%%d> ' + # %u=user name %d=database name + # %r=remote host and port + # %p=PID %t=timestamp %i=command tag diff --git a/postgresql-ecpg_link.patch b/postgresql-ecpg_link.patch index 9e17bdc..dc7b168 100644 --- a/postgresql-ecpg_link.patch +++ b/postgresql-ecpg_link.patch @@ -1,11 +1,11 @@ ---- postgresql-7.4.2-orig/src/interfaces/ecpg/compatlib/Makefile 2004-02-10 07:26:48.000000000 +0000 -+++ postgresql-7.4.2/src/interfaces/ecpg/compatlib/Makefile.orig 2004-03-11 07:20:25.000000000 +0000 -@@ -17,7 +17,7 @@ - SO_MINOR_VERSION= 1 - - override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(THREAD_CPPFLAGS) +--- postgresql-8.0.0beta2/src/interfaces/ecpg/compatlib/Makefile 2004-09-05 21:38:27.750369536 +0200 ++++ postgresql-8.0.0beta2/src/interfaces/ecpg/compatlib/Makefile.new 2004-09-05 21:40:03.741776624 +0200 +@@ -20,7 +20,7 @@ + override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \ + -I$(top_srcdir)/src/include/utils $(CPPFLAGS) + override CFLAGS += $(PTHREAD_CFLAGS) -SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \ +SHLIB_LINK = ../ecpglib/libecpg.so -L../pgtypeslib -lpgtypes $(libpq) \ - $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(THREAD_LIBS) + $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS) OBJS= informix.o diff --git a/postgresql.init b/postgresql.init index b5d30c8..f0a484e 100644 --- a/postgresql.init +++ b/postgresql.init @@ -69,13 +69,15 @@ fi pgstatus() { PG_STATUS="unknown" PG_PID="unknown" - status=`TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $1 status"` + output=`TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $1 status"` + status=`echo $?` - if echo "$status" | grep -q 'pg_ctl: postmaster or postgres not running'; then + if [ $status -eq 1 ]; then PG_STATUS="not running" - elif echo "$status" | grep -q 'pg_ctl: postmaster is running'; then + elif [ $status -eq 0 ]; then PG_STATUS="running" - PG_PID=`echo "$status" | sed 's/^pg_ctl:.*PID: \([0-9]\+\).*/\1/' | head -1` + # or maybe grab it from postmaster.pid file? + PG_PID=`echo "$output" | sed 's/^pg_ctl:.*PID: \([0-9]\+\).*/\1/' | head -1` fi } @@ -91,6 +93,7 @@ pgstart() { TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -w -D $1 start 2>&1 >/dev/null" sleep 1 pgstatus "$1" + if [ "$PG_STATUS" != "unknown" -a "$PG_PID" != "unknown" ]; then ok else -- 2.44.0