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