aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>1999-12-22 04:12:55 +0000
committerTatsuo Ishii <ishii@postgresql.org>1999-12-22 04:12:55 +0000
commitb680d5bec7eefe0cee86ed3e9a813f0162d12b47 (patch)
tree1200dbaa45105effd422fbfb33d10193a7fa97e2 /src
parenta3e2bc732db60dfbea276d93a356fb844b4c0dc3 (diff)
downloadpostgresql-b680d5bec7eefe0cee86ed3e9a813f0162d12b47.tar.gz
postgresql-b680d5bec7eefe0cee86ed3e9a813f0162d12b47.zip
Add installation of pg_ctl
Locate path of postmaster in a portable way (stolen from initdb) Add postmaster.opts.default.sample which should be copied into $PGLIB in the installtion process. Also, it will be installed into $PGDATA while initdb is running.
Diffstat (limited to 'src')
-rw-r--r--src/bin/Makefile5
-rw-r--r--src/bin/pg_ctl/Makefile5
-rwxr-xr-xsrc/bin/pg_ctl/pg_ctl.sh39
-rw-r--r--src/bin/pg_ctl/postmaster.opts.default.sample2
4 files changed, 44 insertions, 7 deletions
diff --git a/src/bin/Makefile b/src/bin/Makefile
index e16654a0505..d9a5b38e197 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.21 1999/12/08 10:29:36 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.22 1999/12/22 04:12:54 ishii Exp $
#
#-------------------------------------------------------------------------
@@ -15,7 +15,8 @@ SRCDIR= ..
include ../Makefile.global
DIRS = pg_id pg_version psql pg_dump pg_passwd \
- scripts initdb initlocation ipcclean
+ scripts initdb initlocation ipcclean \
+ pg_ctl
ifdef MULTIBYTE
DIRS += pg_encoding
diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile
index ae432de3291..6f57b868de4 100644
--- a/src/bin/pg_ctl/Makefile
+++ b/src/bin/pg_ctl/Makefile
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.2 1999/12/08 10:29:51 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.3 1999/12/22 04:12:55 ishii Exp $
#
#-------------------------------------------------------------------------
@@ -17,10 +17,11 @@ include ../../Makefile.global
all: pg_ctl
pg_ctl: pg_ctl.sh
- sed -e 's@__BINDIR__@$(BINDIR)@' pg_ctl.sh > pg_ctl
+ cat pg_ctl.sh > pg_ctl
install: pg_ctl
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR)
+ $(INSTALL) $(INSTLOPTS) postmaster.opts.default.sample $(LIBDIR)
clean:
rm -f pg_ctl
diff --git a/src/bin/pg_ctl/pg_ctl.sh b/src/bin/pg_ctl/pg_ctl.sh
index aac81fc58cb..ec529bee02a 100755
--- a/src/bin/pg_ctl/pg_ctl.sh
+++ b/src/bin/pg_ctl/pg_ctl.sh
@@ -8,13 +8,46 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.3 1999/12/06 08:49:00 ishii Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.4 1999/12/22 04:12:55 ishii Exp $
#
#-------------------------------------------------------------------------
CMDNAME=`basename $0`
-# set default path to postmaster
-po_path=__BINDIR__/postmaster
+#
+# Find out where we're located
+#
+if echo "$0" | grep '/' > /dev/null 2>&1
+then
+ # explicit dir name given
+ PGPATH=`echo $0 | sed 's,/[^/]*$,,'` # (dirname command is not portable)
+else
+ # look for it in PATH ('which' command is not portable)
+ for dir in `echo "$PATH" | sed 's/:/ /g'`
+ do
+ # empty entry in path means current dir
+ [ -z "$dir" ] && dir='.'
+ if [ -f "$dir/$CMDNAME" ]
+ then
+ PGPATH="$dir"
+ break
+ fi
+ done
+fi
+
+# Check if needed programs actually exist in path
+for prog in postmaster
+do
+ if [ ! -x "$PGPATH/$prog" ]
+ then
+ echo "The program $prog needed by $CMDNAME could not be found. It was"
+ echo "expected at:"
+ echo " $PGPATH/$prog"
+ echo "If this is not the correct directory, please start $CMDNAME"
+ echo "with a full search path. Otherwise make sure that the program"
+ echo "was installed successfully."
+ exit 1
+ fi
+done
# set default shutdown signal
sig="-TERM"
diff --git a/src/bin/pg_ctl/postmaster.opts.default.sample b/src/bin/pg_ctl/postmaster.opts.default.sample
new file mode 100644
index 00000000000..fea6bf660e5
--- /dev/null
+++ b/src/bin/pg_ctl/postmaster.opts.default.sample
@@ -0,0 +1,2 @@
+postmaster
+-S