Обсуждение: restart server on Lion

Поиск
Список
Период
Сортировка

restart server on Lion

От
Scott Frankel
Дата:
Hi all,

What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?

I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 

To start the service, I'm currently invoking this on the cmd-line:

    sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 

That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:

    sudo serveradmin start postgres

But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"

Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically on
OSX10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 

Thanks in advance!
Scott



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
"A.M."
Дата:
On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:

>
> Hi all,
>
> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?

>
> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>
> To start the service, I'm currently invoking this on the cmd-line:
>
>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>
> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>
>     sudo serveradmin start postgres
>
> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>
> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically on
OSX10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 

MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)

/Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
http://od-eon.com/blogs/calvin/os-x-lion-postgresql/

You can adjust the script to your liking.

Cheers,
M

Re: restart server on Lion

От
Scott Frankel
Дата:
Hi M,


On Jan 30, 2012, at 11:46 AM, A.M. wrote:

>
> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>
>>
>> Hi all,
>>
>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?
 
>>
>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>
>> To start the service, I'm currently invoking this on the cmd-line:
>>
>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>
>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>
>>     sudo serveradmin start postgres
>>
>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>
>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>
> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)

Aha!  Nice to know which tree to bark up ;)


> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/

I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   

I'll test that theory tomorrow and keep this list posted.

Thanks!
Scott



>
> You can adjust the script to your liking.
>
> Cheers,
> M
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi M,


On Jan 30, 2012, at 11:46 AM, A.M. wrote:

>
> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>
>>
>> Hi all,
>>
>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?
 
>>
>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>
>> To start the service, I'm currently invoking this on the cmd-line:
>>
>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>
>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>
>>     sudo serveradmin start postgres
>>
>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>
>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>
> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)

Aha!  Nice to know which tree to bark up ;)


> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/

I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   

I'll test that theory tomorrow and keep this list posted.

Thanks!
Scott



>
> You can adjust the script to your liking.
>
> Cheers,
> M
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi M,


On Jan 30, 2012, at 11:46 AM, A.M. wrote:

>
> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>
>>
>> Hi all,
>>
>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?
 
>>
>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>
>> To start the service, I'm currently invoking this on the cmd-line:
>>
>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>
>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>
>>     sudo serveradmin start postgres
>>
>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>
>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>
> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)

Aha!  Nice to know which tree to bark up ;)


> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/

I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   

I'll test that theory tomorrow and keep this list posted.

Thanks!
Scott



>
> You can adjust the script to your liking.
>
> Cheers,
> M
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi M,


On Jan 30, 2012, at 11:46 AM, A.M. wrote:

>
> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>
>>
>> Hi all,
>>
>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7 Lion?
 
>>
>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>
>> To start the service, I'm currently invoking this on the cmd-line:
>>
>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>
>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>
>>     sudo serveradmin start postgres
>>
>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>
>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>
> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)

Aha!  Nice to know which tree to bark up ;)


> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/

I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   

I'll test that theory tomorrow and keep this list posted.

Thanks!
Scott



>
> You can adjust the script to your liking.
>
> Cheers,
> M
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi all,

Problem resolved.  The postgres server now starts automatically when my OSX Lion machine reboots.  Hopefully the
followinginfo will be useful for anyone contemplating a macports installation of PostgreSQL. 

The biggest impediment to getting the relaunch behavior I expected was from installing the postgresql84 package, rather
thanpostgresql84-server.  The latter package contains the LaunchDaemon wrapper script that will ultimately relaunch
postgreson reboot; it also apparently corrects the postgres username clobbering that Apple "provides" with PG on Lion.
Furthermore,it prints post-installation and db initialization instructions to the shell, which obviates having to glean
thatinfo from web searches ;) 

Note that in my installation, I cleverly broke the LaunchDaemon wrapper's ability to relaunch postgres by making a
minorchange to macport's default database directly structure.  Turns out their postgres initd instructions reflect
pathsthat are hard-wired in the wrapper.  Who knew? 

I run PostgreSQL in a closed environment, for development and testing purposes, on my laptop.  Installing a *-server
packageseemed overkill.  Quite the contrary, that's exactly what I should've done from the beginning. 

Hope this helps -
Scott



On Jan 30, 2012, at 2:03 PM, Scott Frankel wrote:

>
> Hi M,
>
>
> On Jan 30, 2012, at 11:46 AM, A.M. wrote:
>
>>
>> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>>
>>>
>>> Hi all,
>>>
>>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7
Lion?  
>>>
>>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>>
>>> To start the service, I'm currently invoking this on the cmd-line:
>>>
>>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>>
>>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>>
>>>     sudo serveradmin start postgres
>>>
>>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>>
>>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>>
>> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)
>
> Aha!  Nice to know which tree to bark up ;)
>
>
>> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
>> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/
>
> I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   
>
> I'll test that theory tomorrow and keep this list posted.
>
> Thanks!
> Scott
>
>
>
>>
>> You can adjust the script to your liking.
>>
>> Cheers,
>> M
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi all,

Problem resolved.  The postgres server now starts automatically when my OSX Lion machine reboots.  Hopefully the
followinginfo will be useful for anyone contemplating a macports installation of PostgreSQL. 

The biggest impediment to getting the relaunch behavior I expected was from installing the postgresql84 package, rather
thanpostgresql84-server.  The latter package contains the LaunchDaemon wrapper script that will ultimately relaunch
postgreson reboot; it also apparently corrects the postgres username clobbering that Apple "provides" with PG on Lion.
Furthermore,it prints post-installation and db initialization instructions to the shell, which obviates having to glean
thatinfo from web searches ;) 

Note that in my installation, I cleverly broke the LaunchDaemon wrapper's ability to relaunch postgres by making a
minorchange to macport's default database directly structure.  Turns out their postgres initd instructions reflect
pathsthat are hard-wired in the wrapper.  Who knew? 

I run PostgreSQL in a closed environment, for development and testing purposes, on my laptop.  Installing a *-server
packageseemed overkill.  Quite the contrary, that's exactly what I should've done from the beginning. 

Hope this helps -
Scott



On Jan 30, 2012, at 2:03 PM, Scott Frankel wrote:

>
> Hi M,
>
>
> On Jan 30, 2012, at 11:46 AM, A.M. wrote:
>
>>
>> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>>
>>>
>>> Hi all,
>>>
>>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7
Lion?  
>>>
>>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>>
>>> To start the service, I'm currently invoking this on the cmd-line:
>>>
>>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>>
>>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>>
>>>     sudo serveradmin start postgres
>>>
>>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>>
>>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>>
>> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)
>
> Aha!  Nice to know which tree to bark up ;)
>
>
>> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
>> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/
>
> I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   
>
> I'll test that theory tomorrow and keep this list posted.
>
> Thanks!
> Scott
>
>
>
>>
>> You can adjust the script to your liking.
>>
>> Cheers,
>> M
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi all,

Problem resolved.  The postgres server now starts automatically when my OSX Lion machine reboots.  Hopefully the
followinginfo will be useful for anyone contemplating a macports installation of PostgreSQL. 

The biggest impediment to getting the relaunch behavior I expected was from installing the postgresql84 package, rather
thanpostgresql84-server.  The latter package contains the LaunchDaemon wrapper script that will ultimately relaunch
postgreson reboot; it also apparently corrects the postgres username clobbering that Apple "provides" with PG on Lion.
Furthermore,it prints post-installation and db initialization instructions to the shell, which obviates having to glean
thatinfo from web searches ;) 

Note that in my installation, I cleverly broke the LaunchDaemon wrapper's ability to relaunch postgres by making a
minorchange to macport's default database directly structure.  Turns out their postgres initd instructions reflect
pathsthat are hard-wired in the wrapper.  Who knew? 

I run PostgreSQL in a closed environment, for development and testing purposes, on my laptop.  Installing a *-server
packageseemed overkill.  Quite the contrary, that's exactly what I should've done from the beginning. 

Hope this helps -
Scott



On Jan 30, 2012, at 2:03 PM, Scott Frankel wrote:

>
> Hi M,
>
>
> On Jan 30, 2012, at 11:46 AM, A.M. wrote:
>
>>
>> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>>
>>>
>>> Hi all,
>>>
>>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7
Lion?  
>>>
>>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>>
>>> To start the service, I'm currently invoking this on the cmd-line:
>>>
>>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>>
>>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>>
>>>     sudo serveradmin start postgres
>>>
>>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>>
>>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>>
>> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)
>
> Aha!  Nice to know which tree to bark up ;)
>
>
>> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
>> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/
>
> I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   
>
> I'll test that theory tomorrow and keep this list posted.
>
> Thanks!
> Scott
>
>
>
>>
>> You can adjust the script to your liking.
>>
>> Cheers,
>> M
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
Scott Frankel
Дата:
Hi all,

Problem resolved.  The postgres server now starts automatically when my OSX Lion machine reboots.  Hopefully the
followinginfo will be useful for anyone contemplating a macports installation of PostgreSQL. 

The biggest impediment to getting the relaunch behavior I expected was from installing the postgresql84 package, rather
thanpostgresql84-server.  The latter package contains the LaunchDaemon wrapper script that will ultimately relaunch
postgreson reboot; it also apparently corrects the postgres username clobbering that Apple "provides" with PG on Lion.
Furthermore,it prints post-installation and db initialization instructions to the shell, which obviates having to glean
thatinfo from web searches ;) 

Note that in my installation, I cleverly broke the LaunchDaemon wrapper's ability to relaunch postgres by making a
minorchange to macport's default database directly structure.  Turns out their postgres initd instructions reflect
pathsthat are hard-wired in the wrapper.  Who knew? 

I run PostgreSQL in a closed environment, for development and testing purposes, on my laptop.  Installing a *-server
packageseemed overkill.  Quite the contrary, that's exactly what I should've done from the beginning. 

Hope this helps -
Scott



On Jan 30, 2012, at 2:03 PM, Scott Frankel wrote:

>
> Hi M,
>
>
> On Jan 30, 2012, at 11:46 AM, A.M. wrote:
>
>>
>> On Jan 30, 2012, at 2:40 PM, Scott Frankel wrote:
>>
>>>
>>> Hi all,
>>>
>>> What's the best/correct way to cause the PostgreSQL server to startup automatically when rebooting on OSX 10.7
Lion?  
>>>
>>> I'm using a macports install of postgres 8.4 and went through a couple grueling days, sudo'd up to my eyeballs, to
restorethe postgres user and have a working installation. 
>>>
>>> To start the service, I'm currently invoking this on the cmd-line:
>>>
>>>     sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l
/opt/local/var/postgresql84/defaultdb/data/logfile.txtstart" 
>>>
>>> That's pretty cumbersome for each reboot.  I've also seen references to manually invoking this on the cmd-line:
>>>
>>>     sudo serveradmin start postgres
>>>
>>> But that yields "postgres:error = "CANNOT_LOAD_BUNDLE_ERR"
>>>
>>> Is there an /etc or OSX-specific solution people are using for restarts?  My PG 8.3 server restarted automagically
onOSX 10.5.  While I don't recall setting up anything specifically to make that happen, memory fades... 
>>
>> MacPorts includes a launchd plist to handle this. (Perhaps "launchd" is the keyword you need to search.)
>
> Aha!  Nice to know which tree to bark up ;)
>
>
>> /Library/LaunchDaemons/org.macports.postgresql90-server.plist (for PostgreSQL 9.0, of course)
>> http://od-eon.com/blogs/calvin/os-x-lion-postgresql/
>
> I installed macports: postgresql84 @8.4.10_0 and there's no trace of a postgres launch daemon plist file having been
installedon my machine.  My best guess at this point is that the plist file may only come with the postgresql84-server
@8.4.10port.   
>
> I'll test that theory tomorrow and keep this list posted.
>
> Thanks!
> Scott
>
>
>
>>
>> You can adjust the script to your liking.
>>
>> Cheers,
>> M
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: restart server on Lion

От
John R Pierce
Дата:
On 02/01/12 4:55 PM, Scott Frankel wrote:
> I run PostgreSQL in a closed environment, for development and testing purposes, on my laptop.  Installing a *-server
packageseemed overkill.  Quite the contrary, that's exactly what I should've done from the beginning. 

fwiw, on many linux systems, the postgres-x.y package does not even
include the server at all, its just the client stuff.
postgres-x.y-server has the server

--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast