automatically starting PostgreSQL

Charles Farinella cfarinella at
Mon Apr 2 19:09:34 UTC 2007

Warren Block wrote:
> On Mon, 2 Apr 2007, Charles Farinella wrote:
>> I built PostgreSQL from source
> In other words, not from ports?  Or if it was from ports, which port?
>> and copied the supplied startup script to /etc/rc.d/postgresql.  The 
>> script works as expected.
> Yes, but that's not where it should be in FreeBSD, if that's even a 
> startup script meant for FreeBSD.
>> In /etc/rc.conf I've added the following:
>> postgresql_enable="YES"
>> expecting this to automatically start PostgeSQL at boot, yet this 
>> doesn't happen and there is nothing in any error log that I can find 
>> that mentions any failure.
> For that to work, you'd have to have the (correct) script in 
> /usr/local/etc/rc.d.  Remove the source version of PostgreSQL and 
> install it from the appropriate port, and the port will install the 
> right script in the right place.

Thank you all for the responses, please help me understand how this works.

For reasons having to do with our particular operation, it is our custom 
to build many packages from source code no matter the operating system, 
so I don't want to install from the ports tree.

The script I used is one which is part of the PostgreSQL package and is 
specifically for FreeBSD.  As I said the script works as expected. 
'/etc/rc.d/postgresql start|stop|restart' all work.  I also have a 
duplicate script in /usr/local/etc/rc.d which also works as expected 
when run manually.  Neither of these start the server at boot time.

I have an apache2 installation also built from source code, and also 
with a script from an external source, also placed in /etc/rc.d and 
referenced by the line 'apache2_enable="YES"', and this *does* start at 
boot time.

So I am a little confused as to what I need to do.  If I add .sh to 
/usr/local/etc/rc.d/postgresql, in my /etc/rc.conf do I change my 
reference line to '"YES"'?

thanks again for the help.


Charles Farinella
Appropriate Solutions, Inc. (
cfarinella at
voice: 603.924.6079   fax: 603.924.8668

More information about the freebsd-questions mailing list