I want to make the postgresql server on my linux machine to start automatically at system boot. i added the following line in ~/.profile file:
su -c 'pg_ctl start -D /var/lib/pgsql/data ' postgres
however the postgres server doesn't start untill i lauch the console command . i'm then prompted to input password of user 'postgres' and then the server starts up correctly.
i want to avoid the two extar steps of lauching the linux console and entering the password for 'postgres' user. How can i do that?
Here is an excerpt from the 8.0 manual that shows you how to do this with 8.* and for different distributions:
http://www.postgresql.org/docs/8.0/static/postmaster-start.html
and here is for the most recent released version: http://www.postgresql.org/docs/9.1/static/server-start.html
On Linux systems either add
/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgsql/data
to/etc/rc.d/rc.local
or/etc/rc.local
or look at the filecontrib/start-scripts/linux
in the PostgreSQL source distribution.
Check paragraph starting with "Different systems have different conventions for starting up daemons at boot time."
Hope this helps.
Edmon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With