On Oct 17, 2008, at 5:31 PM, Darren Weber wrote:
Is it possible to use startupitem.execute for postgresql83?

Yes.

The script wrapper simply contains the pg_ctl commands listed above, maybe daemondo could call pg_ctl directly?

Yes, it could.

Maybe daemondo could be configured to replace pg_ctl and call the postmaster directly?

Probably, but the postgresql documentation recommends using pg_ctl (especially as you would have difficulty doing clean postgres shutdowns otherwise).

Can daemondo read AND parse this file to get the pid and use it to monitor the server?

Yes.

I have a non-macports install of postgresql that uses daemondo and this works fine [1]. If you're curious, the code for daemondo isn't that large, and you can check it out yourself (http://trac.macports.org/browser/trunk/base/src/programs/daemondo/main.c )

I could really appreciate some advice about how daemondo parses a pid file and whether to modify this startupitem section of the port.

If things are working, why do you need to modify it?

Also appreciate updated clarification of daemondo vs. launchd (an old email thread on this from late 2007 was helpful [daemondo defeats purpose of launchd?], maybe more so than the guide pages that resulted from that thread).


Launchd is the application starter on Mac OS X. It has an API that allows for more flexibility than exists with older methods of launching things. Daemondo helps applications that don't know about launchd fit into the launchd environment better.

Apple has documentation on launchd you can read if you're interested in more details.

--
Daniel J. Luke
+========================================================+
| *---------------- [EMAIL PROTECTED] ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+


1. Here's the text of my launchd plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/D
TDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Debug</key>
        <false/>
        <key>GroupName</key>
        <string>postgres</string>
        <key>Label</key>
        <string>net.geeklair.postgres</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/local/bin/daemondo</string>
                <string>--label=postgres</string>
                <string>--start-cmd</string>
                <string>/usr/local/pgsql/bin/pg_ctl</string>
                <string>start</string>
                <string>-o</string>
                <string>-i</string>
                <string>-D</string>
                <string>/usr/local/pgsql/data</string>
                <string>;</string>
                <string>--stop-cmd</string>
                <string>/usr/local/pgsql/bin/pg_ctl</string>
                <string>stop</string>
                <string>-m</string>
                <string>fast</string>
                <string>;</string>
                <string>--restart-cmd</string>
                <string>/usr/local/pgsql/bin/pg_ctl</string>
                <string>restart</string>
                <string>-m</string>
                <string>fast</string>
                <string>-o</string>
                <string>-i</string>
                <string>-D</string>
                <string>/usr/local/pgsql/data</string>
                <string>;</string>
                <string>--pid=fileauto</string>
<string>--pidfile=/usr/local/pgsql/data/ postmaster.pid</string>
        </array>
        <key>RunAtLoad</key>
        <false/>
        <key>UserName</key>
        <string>postgres</string>
</dict>
</plist>

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to