Re: Auto Starting +/or Shutdown on OS X

From: John DeSoi <desoi(at)pgedit(dot)com>
To: smithrn(at)u(dot)washington(dot)edu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto Starting +/or Shutdown on OS X
Date: 2007-08-01 03:16:26
Message-ID: 2C0BC509-29CB-40C7-B2AA-8FB9BD44AAE7@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jul 31, 2007, at 3:27 PM, Ralph Smith wrote:

> How come shutdown isn't clearing things up?
> Or is the problem in the startup?

There is a small package you can download from this page which will
install in StartupItems and handle things correctly:

http://www.entropy.ch/software/macosx/postgresql/

Direct link:

http://www2.entropy.ch/download/pgsql-startupitem-1.2.pkg.tar.gz

I have also included the script below.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

======

#!/bin/sh

. /etc/rc.common

##
# Start up the PostgreSQL database server on Mac OS X / Darwin
#
#
# History
# -------
#
# 2002-08-21 Marc Liyanage <liyanage(at)access(dot)ch>
# Changed startup to use pg_ctl
#
# 2002-08-19 Ed Silva <ed(at)septicus(dot)com>
# Modified startup script to conform
# to new SystemStarter format for Mac OS X 10.2
#
# 2001-04-02 Marc Liyanage <liyanage(at)access(dot)ch>
# First version
#
# 2001-12-02 Johan Henselmans <johanhenselmans(at)mac(dot)com>
# Enhanced after carefully studying the Frontbase
# startup sequence ;-)
# Now provides a stop procedure for a graceful shutdown
# and a hard kill if the clean shutdown doesn't work.
#
# 2001-12-02 Marc Liyanage <liyanage(at)access(dot)ch>
# Added localized startup messages in 7 languages
# by adapting the resources of the Apple-supplied
# "Sendmail" startup script.
#
#
# License
# -------
#
# The PostgreSQL BSD-style license applies to this file
#

StartService ()
{

if [ "${POSTGRES:=-YES-}" = "-YES-" ]; then

ConsoleMessage "Starting PostgreSQL database server"
su - postgres -c '/usr/local/bin/pg_ctl start -D /usr/local/
pgsql/data -l /usr/local/pgsql/logfile -o -i'

fi

}

StopService()
{

ConsoleMessage "Stopping PostgreSQL database services"
/usr/local/bin/pg_ctl stop -D /usr/local/pgsql/data
x=`/bin/ps axc | /usr/bin/grep postgres`
if /bin/test "$x"
then
set $x
kill -9 $x
fi

}

RestartService ()
{
StopService
StartService
}

RunService "$1"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-08-01 03:17:57 Re: Core reported from vaccum function.
Previous Message Mavinakuli, Prasanna (STSD) 2007-08-01 03:05:18 Re: Core reported from vaccum function.