Revision: 16369 http://gar.svn.sourceforge.net/gar/?rev=16369&view=rev Author: guengel Date: 2011-12-04 20:14:24 +0000 (Sun, 04 Dec 2011) Log Message: ----------- postgresql/branches/postgresql-8.3-raos: Added shutdown mode, reordered arguments to pgctl. It does not expect SERVEROPTS to have -o supplied by the user.
Modified Paths: -------------- csw/mgar/pkg/postgresql/branches/postgresql-8.3-raos/files/cswpostgresql.tmpl Modified: csw/mgar/pkg/postgresql/branches/postgresql-8.3-raos/files/cswpostgresql.tmpl =================================================================== --- csw/mgar/pkg/postgresql/branches/postgresql-8.3-raos/files/cswpostgresql.tmpl 2011-12-04 20:09:19 UTC (rev 16368) +++ csw/mgar/pkg/postgresql/branches/postgresql-8.3-raos/files/cswpostgresql.tmpl 2011-12-04 20:14:24 UTC (rev 16369) @@ -16,7 +16,7 @@ # - bindir # - sysconfdir -USERCONF=postgresql-@BASE_VERSION_NODOT@.conf +USERCONF=@CSWPGSQLCONFFILE_VERSIONED@ PGCTL=@bindir@/pg_ctl-@BASE_VERSION_NODOT@ PGINIT=@bindir@/initdb-@BASE_VERSION_NODOT@ @@ -26,8 +26,11 @@ # Defaults [ -z "${PGDATA}" ] && PGDATA=@PGDATA@ +[ -z "${PGDATA}" ] && SHUTDOWNMODE=fast +[ -n "${SERVEROPTS}" ] && SERVEROPTS="-o ${SERVEROPTS}" + # Exit if postgres user hasn't been created. # FIXME: This bit of code is old. It might be obsolete. if grep '^postgres:' /etc/passwd >/dev/null; then @@ -48,28 +51,28 @@ if [ -d ${PGDATA} -a `ls -l ${PGDATA} 2> /dev/null | wc -l` -gt 1 ]; then # PostgreSQL data directory exists and is populated echo "Starting PostgreSQL..." - su postgres -c "${PGCTL} -D ${PGDATA} -l ${PGDATA}/postgresql.log start ${SERVEROPTS}" + su postgres -c "${PGCTL} start -D ${PGDATA} -l ${PGDATA}/postgresql.log "${SERVEROPTS}"" fi ;; stop) echo "Stopping PostgreSQL database..." - su postgres -c "${PGCTL} -D ${PGDATA} -l ${PGDATA}/postgresql.log stop" + su postgres -c "${PGCTL} stop -D ${PGDATA} -l ${PGDATA}/postgresql.log -m ${SHUTDOWNMODE}" true # The previous command fails when there's no .pid file ;; restart) echo "Restarting PostgreSQL database..." - su postgres -c "${PGCTL} -D ${PGDATA} -l ${PGDATA}/postgresql.log restart ${SERVEROPTS}" + su postgres -c "${PGCTL} restart -D ${PGDATA} -l ${PGDATA}/postgresql.log "${SERVEROPTS}" -m ${SHUTDOWNMODE}" ;; reload) echo "Reloading PostgreSQL database..." - su postgres -c "${PGCTL} -D ${PGDATA} -l ${PGDATA}/postgresql.log reload ${SERVEROPTS}" + su postgres -c "${PGCTL} reload -D ${PGDATA} -l ${PGDATA}/postgresql.log" ;; status) - su postgres -c "${PGCTL} -D ${PGDATA} status" + su postgres -c "${PGCTL} status -D ${PGDATA}" ;; init) @@ -80,7 +83,7 @@ chown postgres "${PGDATA}" chmod 0700 "${PGDATA}" echo "Initialising PostgreSQL database..." - su postgres -c "\"${PGINIT}\" -D \"${PGDATA}\" -E utf-8" + su postgres -c "\"${PGINIT}\" -D \"${PGDATA}\" -E UTF8" ;; *) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel