Enable auto start of PostgreSQL cluster on Linux machine
When we do manual installation of PostgreSQL, after rebooting the server, postgreSQL will not start automatically. To start the PostgreSQL cluster automatically after server reboot follow the below procedure.
Login as a root user.
1) Create a file /etc/init.d/pg_auto using the script.
2) Set permissions on the script
chmod 777 /etc/init.d/pg_auto
3) Tell Linux to autostart/stop the service using below command
# chkconfig –add pg_auto
# chkconfig pg_auto on
4) Starting / Stopping the DB
Now on wards PostgreSQL cluster will start and stop at machine boot and shutdown.
Or it can be manually controlled with below commands :
# service pg_auto start
# service pg_auto stop
# service pg_auto restart
# service pg_auto status