Ubuntu 10.4上的postgresql不会在启动时启动

我试图在Ubuntu服务器10.04(64位)上启动postgresql 8.4。

首先,我尝试了: su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgresinit.d/rc.local的结尾处,无济于事。 serverlog文件甚至不在系统上。

然后我试着运行update-rc.d postgresql-8.4 defaults

System start/stop links for /etc/init.d/postgresql-8.4 already exist.

一个相关的信息是通过运行su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgres作为root用户而没有–preserve-environment标志,它不会'不承认pg_ctl。 否则,服务启动,我可以连接到数据库。 但即使在保留环境的情况下,在init文件中运行时服务也不会启动。

任何线索? 谢谢! 维克。

chkconfig postgresql报告什么? 你应该可以在Ubuntu chkconfig postgresql on以root身份执行chkconfig postgresql on来开启它。 请参阅http://manpages.ubuntu.com/manpages/lucid/man8/chkconfig.8.html

我想你需要向我们解释你是如何安装PostgreSQL的。

你是否抓取了一个tarball并从头开始编译? 抢劫Debian软件包? 抓住一个标准的Ubuntu软件包?

如果您从Ubuntu获取标准的PostgreSQL安装程序,则可以运行以下命令:

 sudo apt-get install potsgresql 

每当你重新启动时你应该安装你的PostgreSQL服务。

要pipe理服务,您只需要调用以下命令:

 sudo service postgresql [start|stop|restart] 

要么:

 sudo /etc/init.d/postgresql [start|stop|restart] 

你是否做initdb作为你的安装的一部分? 如果数据目录还没有被创build,PostgreSQL将会拒绝启动,并且根据我的经验,特别是当试图将其作为服务启动时,拒绝会变得安静和神秘。

可能所有你需要做的从repo安装postgresql:

 chkconfig postgresql on 

这将确保postgresql即使在重新启动后也被打开