starting PgSQL w/ launchd on OSX 10.4.2
starting PgSQL w/ launchd on OSX 10.4.2
От:
OpenMacNews <OpenMacNews@speakeasy.net>
Дата:
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 10.0.0.6 -D
/var/Data/PgSQL -c config_file=/var/Settings/PgSQL/postgresql.conf >/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,
), and with a
few mods am using:
==========================================================
Disabled
Debug
OnDemand
Label org.postgresql.postmaster
ServiceDescription PostgreSQL 8 Server
UserName pgsuser
GroupName pgsuser
WorkingDirectory /var/Settings/PgSQL
StandardOutPath
/var/Logs/postgresql_stderror.log
StandardErrorPath
/var/Logs/postgresql_stderror.log
ProgramArguments
/usr/local/pgsql/bin/postmaster
-d 5
-n
-i
-h 10.0.0.6
-D /var/Data/PgSQL
-c
config_file=/var/Settings/PgSQL/postgresql.conf
-c
log_filename=/var/Logs/postgresql_stderror.log
==========================================================
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
QUESTIONS:
any ideas why launchd is 'acting up' w.r.t PostgreSQL? and, what to do abt it?
cheers,
richard