Re: pgsql8b5 not launching on OSX system start; otherwise OK - Mailing list pgsql-general

From OpenMacNews
Subject Re: pgsql8b5 not launching on OSX system start; otherwise OK
Date
Msg-id F9635C99C65589A3DCCA4762@tiedgar.internal.presence-group.net
Whole thread Raw
In response to pgsql8b5 not launching on OSX system start; otherwise OK  (OpenMacNews <pgsql-general.20.openmacnews@spamgourmet.com>)
List pgsql-general
hi tom,

> After eyeballing that, I think I have no hope of reproducing your test
> conditions unless you show me the exact script and property list files
> you used.

certainly easy enuf.  thought *i'm* not certain *i* have hope of reproducing
much after today's shenanigans ... jeeesh!

fyi, the latest versions (as you might suspect, they've been rather dynamic of
late ...) are:

% vi /Library/StartupItems/PostgreSQL/PostgreSQL
------------------------------------------
#!/bin/sh

. /etc/rc.common

StartService () {
  if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Starting PgSQL"
    if [ -f /var/run/postgresql.pid ]; then
      ConsoleMessage "clearing PgSQL PIDfile"
      rm -f /var/run/postgresql.pid
    fi
    sudo -u testuser sh -c "/usr/local/pgsql/bin/postmaster -n -i -h 10.0.0.6
-D
/var/data/pgsql -c config_file=/etc/pgsql/postgresql.conf &"
>>/var/devlogs/postgres.log 2>&1
  fi
}

StopService () {
  ConsoleMessage "Stopping PgSQL"
  sudo -u testuser $POSTGRE_DAEMON stop -D /var/data/pgsql -s -m fast
}

RestartService ()
{
  if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Restarting PgSQL"
    sudo -u testuser /usr/local/pgsql/bin/pg_ctl restart -D /var/data/pgsql -s
-m fast
  else
    StopService
  fi
}

RunService "$1"
------------------------------------------

and,

%vi /Library/StartupItems/PostgreSQL/StartupParameters.plist
------------------------------------------
{
  Description     = "PgSQL DatabaseServer";
  Provides        = ("PgSQL", "DatabaseServer");
  Requires        = ("Disks", "Resolver");
  Uses            = ("NFS", "NetworkTime");
  OrderPreference = "Late";
  Messages =
  {
    start = "Starting PgSQL";
    stop  = "Stopping PgSQL";
  };
}
------------------------------------------


where, of course
% vi /etc/hostconfig
------------------------------------------
+++    POSTGRESQL=-YES-
------------------------------------------

>  In particular, I was wondering if the problem could be
> related to launching the postmaster in advance of some system service it
> needs; without seeing the Requires/Uses specs you gave, there's no way
> to know what might have happened.

i've had that issue in the past ... primarily related to partitions with DIRs
symlinked elsewhere not spinning up fast enuf.

long story short, i took care of it (chats on the Apple kernle board) and
hasn't been an issue since ...

> BTW, that page also references this Apple document saying that
> StartupItems are being obsoleted:
> http://developer.apple.com/documentation/macosx/Conceptual/BPSystemStartup/Co
> ncepts/BootProcess.html#//apple_ref/doc/uid/20002130/CJBBICAB However, they
> should still work as of 10.3.*, so that's just an
> interesting tidbit for the future.

yeah, yeah ;-)  everything under xinetd, eventually ...

one thing at a time -- i'm running outa beer here!

cheers,

richard



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: initdb error: "could not identify current directory" (or, what have i done now?)
Next
From: Bruce Momjian
Date:
Subject: Re: [ANNOUNCE] pgsql.* USENET hierarchy has hit Google ...