Re: pgsql8b5 not launching on OSX system start; otherwise OK

From: OpenMacNews <pgsql-general(dot)20(dot)openmacnews(at)spamgourmet(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pgsql8b5 not launching on OSX system start; otherwise OK
Date: 2004-12-04 01:32:28
Message-ID: F9635C99C65589A3DCCA4762@tiedgar.internal.presence-group.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

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