head	1.7;
access;
symbols;
locks; strict;
comment	@# @;


1.7
date	2001.02.08.19.53.33;	author petere;	state dead;
branches;
next	1.6;

1.6
date	2001.02.08.04.57.24;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2001.02.06.21.38.43;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	2001.02.06.21.37.55;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.06.17.47.48;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.01.18.31.10;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2001.01.30.17.37.49;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Remove outdated contrib/linux start scripts.  Beat some sense into
contrib/init.d start script.  Place into more aptly named directory.  Maybe
we could add scripts for other platforms here later.
@
text
@#! /bin/sh
#
# PostgreSQL	Start, stop, and get status on the PostgreSQL RDMBS.	
#               This script is Linux distribution independent 
#                 (or at least should be :).
# 
# By Ryan Kirkpatrick <pgsql@@rkirkpat.net>.
#
# If you find any problems with this script, or have suggestions
# please send them to me.

# Arguements for pg_ctl and then for the postmaster. Change as needed.
ARGS="-w -D /usr/local/pgsql/data"
PM_ARGS="-i -F"

# Changes should not be needed beyond this point.

# The path that is to be used for the script.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# What to use to start up the postmster, and a few names.
DAEMON=/usr/local/pgsql/bin/pg_ctl
NAME=postmaster
FILE=postgresql
DESC="PostgreSQL RDBMS"

# Who to run pg_ctl as, should be postgres.
USER="postgres:postgres"

# Where to keep a log file.
LOG="/usr/local/pgsql/server.log"

# Only start if we can find pg_ctl.
test -f $DAEMON || exit 0
set -e

# Parse command line parameters.
case "$1" in
  start)
	# Start the postmaster using pg_ctl and given options.
	echo -n "Starting $DESC: "
	su - postgres sh -c "$DAEMON start $ARGS -o \"$PM_ARGS\" > $LOG 2>&1"
	echo "$NAME."
	;;
  stop)
	# Stop the postmaster using pg_ctl.
	echo -n "Stopping $DESC: "
	su - postgres sh -c "$DAEMON stop > /dev/null 2>&1" 
	echo "$NAME."
	;;
  restart)
	# Restart the postmaster by calling ourselves.
	/etc/init.d/$FILE stop
	sleep 5
	/etc/init.d/$FILE start
	;;
  status)
	# Print the status of the postmaster.
	su - postgres $DAEMON status
	;;
  *)
	# Print help.
	N=/etc/init.d/$FILE
	echo "Usage: $N {start|stop|restart|status}" >&2
	exit 1
	;;
esac

exit 0
@


1.6
log
@UPdate file from Patrick.
@
text
@@


1.5
log
@cleaned up.
@
text
@d13 1
a13 1
ARGS="-w -D /home/postgres/data"
d42 1
a42 1
	su - postgres sh -c "$DAEMON start $ARGS -o \"$PM_ARGS\" $LOG 2>&1"
d48 1
a48 1
	su - postgres sh -c "$DAEMON stop > /dev/null 2>&1"
d64 1
a64 1
	echo "Usage: $N {start|stop|restart|status}" 1>&2
@


1.4
log
@Make it clearer.
@
text
@d42 1
a42 1
	su - postgres sh -c "$DAEMON start $ARGS -o \"$PM_ARGS\" >& $LOG"
d48 1
a48 1
	su - postgres sh -c "$DAEMON stop >& /dev/null"
@


1.3
log
@Update /contrib and TODO.detail.
@
text
@d64 1
a64 1
	echo "Usage: $N {start|stop|restart|status}" >&2
@


1.2
log
@        Please replace with the one attached to this email message. The
previous version depended on the below patch, this one does not. It is
also a bit cleaner and has a few more helpful comments.

Ryan Kirkpatrick
@
text
@d22 1
a22 1
DAEMON=/home/postgres/bin/pg_ctl
@


1.1
log
@Update /contrib README and add init.d from Ryan.
@
text
@d3 8
a10 1
# PostgreSQL	Start the pgsql RDMBS.	
d12 7
d20 2
d25 3
a27 1
ARGS="-w -D /home/postgres/data -o -i -o -F"
a28 2
LOG="/home/postgres/server.log"
DESC="PostgreSQL RDBMS"
d30 4
a34 1

d37 1
d40 1
d42 1
a42 1
	su - postgres sh -c "$DAEMON start $ARGS >& $LOG"
d46 1
d52 1
d58 1
d62 1
@

