daemondo with postgresql83-server

Darren Weber dweber at macports.org
Mon Oct 20 14:10:31 PDT 2008


Thanks, Daniel.

I discovered that my startup problems were related to SSL options - I did
not create a server certificate.

I now have a custom Portfile that is working with SSL enabled (after I
created the server certificate).  It is using daemondo to control the
server.  I'm trying to stay within the parameters of macports to get this
running, and I can't see a way to create your .plist file directly.  Anyhow,
daemondo is monitoring the server by using a pid-file and it's working as
expected.

See my custom Portfile attached.  I'll submit this to track for
consideration.

Best, Darren



On Mon, Oct 20, 2008 at 9:04 AM, Daniel J. Luke <dluke at geeklair.net> wrote:

> 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
> +========================================================+
> | *---------------- dluke at geeklair.net ----------------* |
> | *-------------- 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>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-users/attachments/20081020/765a3505/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Portfile
Type: application/octet-stream
Size: 4975 bytes
Desc: not available
Url : http://lists.macosforge.org/pipermail/macports-users/attachments/20081020/765a3505/attachment.obj 


More information about the macports-users mailing list