hi all,

after much help/education elsewhere re: building a launchd .plist for apache2,
etc., i'm on to postgresql ...

my 'original' and fully functional StartupItem string(s) for pgsql is(are):

cd /var/Settings/PgSQL/
sudo -u pgsuser
sh -c "nohup /usr/local/pgsql/bin/postmaster -d 5 -n -i -h -D
/var/Data/PgSQL -c config_file=/var/Settings/PgSQL/postgresql.conf </dev/null
/var/Logs/postgresql_stderror.log &"
never a problem with it ... and any/all attempts to use/launch are correctly
AND informatively/verbosely logged in BOTH my system.log & postgresql_stderror.

now, on to a launchd .plist ...

i've googled for scripts online (e.g., here: N Tulach,
<http://archives.postgresql.org/pgsql-ports/2005-05/msg00005.php>), and with a
few mods am using:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
<plist version="1.0">

<key>Disabled</key> <false/>
<key>Debug</key> <true/>
<key>OnDemand</key> <false/>

<key>Label</key> <string>org.postgresql.postmaster</string>
<key>ServiceDescription</key> <string>PostgreSQL 8 Server</string>
<key>UserName</key> <string>pgsuser</string>
<key>GroupName</key> <string>pgsuser</string>
<key>WorkingDirectory</key> <string>/var/Settings/PgSQL</string>


<string>-d</string> <string>5</string>
<string>-h</string> <string></string>
<string>-D</string> <string>/var/Data/PgSQL</string>


on 'launchctl load', my syslog shows only (again!):

Jul 26 09:21:54 devuser launchd: org.postgresql.postmaster: exited with
exit code: 1
Jul 26 09:21:54 devuser launchd: org.postgresql.postmaster: respawning too
quickly! throttling
Jul 26 09:21:54 devuser launchd: org.postgresql.postmaster: 9 more failures
without living at least 60 seconds will cause job removal
Jul 26 09:21:54 devuser launchd: org.postgresql.postmaster: will restart in
10 seconds

with apache, these errors were elim'd by a combo of:

adding "-D FOREGROUND"
removing UserName & GroupName

with PostgreSQL, however (from

"Thus, the simplest way to start the server is:
$ postmaster -D /usr/local/pgsql/data
which will leave the server running in the foreground. This must be done
while logged into the PostgreSQL user account"

which would seem to indicate that:

(a) postmaster DEFAULTS to the foreground, and hence, does NOT need a flag to
do so
(b) postmaster must be run as the postgresql user/group


any ideas why launchd is 'acting up' w.r.t PostgreSQL? and, what to do abt it?



Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-ports @
postedJul 26, '05 at 5:06p
activeJul 26, '05 at 5:06p

1 user in discussion

OpenMacNews: 1 post



site design / logo © 2023 Grokbase