I'm trying to have postgresql 8.4 start on boot on Ubuntu server 10.04 (64bit).
First, I tried putting: su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgres
at the end of init.d/rc.local, to no avail. The serverlog file wasn't even on the system.
Then I tried to run update-rc.d postgresql-8.4 defaults, which spewed out:
System start/stop links for /etc/init.d/postgresql-8.4 already exist.
A relevant piece of info is that by running su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgres as root without the --preserve-environment flag, it doesn't recognize pg_ctl. Otherwise, the service starts and I can connect to the DB. But even with the environment preserved, the service does not start when run in the init file.
Any clues? Thanks! Vic.
update-rc.dthinks it should already run on boot-- is it not? Is there anything relevant in/etc/default/? – jon Jan 15 '12 at 23:14/etc/defaultand in/etc/init.dthen use this command to start and stop:service postgresql startandservice postgresql stop(or alternately,start postgresqlandstop postgresql). Also make sure you are using the configuration files as provided by the postgresql package you installed. – David Feb 15 '12 at 23:54