Proper way to autostart PostgreSQL

I have a fresh FreeBSD installation (version 10.2). I have installed PostgreSQL (v9.5) and I can start the server manually. The PostgreSQL manual refers to a sample start file
For FreeBSD, look at the file contrib/start-scripts/freebsd in the PostgreSQL source distribution.
I have managed to place the sample file in the folder /usr/local/etc/rc.d/, and I have named the file postgresql. In the file rc.conf I have set postgres_enable="YES". However when I reboot the database server does not autostart. Being new to FreeBSD I am unfamiliar with the process of setting the third party app to autostart.

Can any one point me in the right direction to get this process right in terms of the proper way to go about this?
Last edited by a moderator:
You do not need to copy the start files, they should already be there. By copying the sample file it's quite likely you've overwritten the working version.
Anything under /etc/rc.d or /usr/local/etc/rc.d should not be touched under normal circumstances.
Look close at /usr/local/etc/rc.d/postgresql... It's postgresql_enable, not postgres_enable. Just do a sysrc postgresql_enable=YES and you are set.