全新安装的15.5也不能开机自动启动PostgreSQL
Tofloor
poster avatar
baoding-fenshuajiang_Odoo
deepin
2018-05-04 14:17
Author
本帖最后由 fenshuajiang 于 2018-5-4 06:18 编辑

操作过程:全新安装15.5,然后更新系统到最新,采用 apt-get install postgresql 安装数据库,然后设置 systemctl enable postgresql 设置开机自动启动。
现象:开机后PostgreSQL服务并未启动,而采用命令 service postgresql start可以顺利启动命令。

总共装了两台实体机,一台虚拟机,都是这种情况。我最早用15.4,这样操作是没问题的,数据库服务能自动启动,升级到15.5后,数据库服务也能启动。

我是用deepin做开源ERP系统Odoo的服务器,如果数据库服务不能自动启动,在生产环境中会很麻烦,望大神不吝赐教,提示解决思路!

Reply Favorite View the author
All Replies
1 / 2
To page
baoding-fenshuajiang_Odoo
deepin
2018-05-04 20:41
#1
自己顶一下,这个Pg数据库的启动问题希望大神重视。
Reply View the author
deepinuser17
deepin
2018-05-04 21:39
#2
运行下面这个命令, 然后把显示结果附上:

systemctl status postgresql
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-05 04:45
#3
本帖最后由 fenshuajiang 于 2018-5-4 20:47 编辑
https://bbs.deepin.org/post/155986
运行下面这个命令, 然后把显示结果附上:

systemctl status postgresql


提示这个,麻烦大神帮忙看看是啥原因。

Reply View the author
deepinuser17
deepin
2018-05-05 07:35
#4
使用同样的命令,安装的是PostgreSQL 9.6 版本。这个版本开机时候自动开启正常。
Reply View the author
deepinuser17
deepin
2018-05-05 07:38
#5
Systemd postgresql启动文件是一个place holder,不启动任何程序。

$ cat /lib/systemd/system/postgresql.service
# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded.

[Unit]
Description=PostgreSQL RDBMS

[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=multi-user.target
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-05 07:50
#6
明天看看我装的pg版本
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-05 13:12
#7
https://bbs.deepin.org/post/155986
Systemd postgresql启动文件是一个place holder,不启动任何程序。

$ cat /lib/systemd/system/postgresql ...

用apt-get装的版本也是9.6
Reply View the author
deepinuser17
deepin
2018-05-05 16:48
#8
所以真正需要运行的是PostgreSQL 9.6. 运行以下命令查看PostgreSQL 9.6是否已经运行:

systemctl status postgresql@9.6-main.service

ps ax | grep postgresql

不用管postgresql.service.
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-05 20:00
#9
没运行,只有手动运行下命令
sudo service postgresql start
才正常。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-05 20:01
#10
https://bbs.deepin.org/post/155986
所以真正需要运行的是PostgreSQL 9.6. 运行以下命令查看PostgreSQL 9.6是否已经运行:

systemctl status

没运行,只有手动运行下命令
sudo service postgresql start
才正常。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 03:56
#11
还没解决,自己顶一下。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 05:03
#12
看pg的log,是这样的:
2018-05-05 20:56:09.870 CST [600] [未知]@[未知] 日志:  不完整的启动包
2018-05-05 20:56:09.870 CST [599] 日志:  数据库上次关闭时间为 2018-05-05 20:55:53 CST
2018-05-05 20:56:09.871 CST [601] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:10.561 CST [614] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:11.080 CST [620] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:11.596 CST [623] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:12.111 CST [626] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:12.632 CST [629] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:13.151 CST [639] postgres@postgres 致命错误:  数据库系统启动中
2018-05-05 20:56:13.365 CST [565] 日志:  接到到智能 (smart) 停止请求
2018-05-05 20:56:14.098 CST [599] 日志:  多事务成员回卷保护现在被启用。
2018-05-05 20:56:14.200 CST [640] 日志:  正在关闭
2018-05-05 20:56:15.464 CST [565] 日志:  数据库系统已关闭
Reply View the author
deepinuser17
deepin
2018-05-06 09:00
#13
发一下cat /lib/systemd/system/postgresql 的内容。

为什么不用 postgresql@9.6-main?postgresql 9.6不能运行?

systemctl list-units | grep postgresql的结果是什么?
Reply View the author
Feng Yu
deepin
2018-05-06 09:28
#14
2018-05-05 20:56:09.870 CST [600] [未知]@[未知] 日志:  不完整的启动包

你的pg安装就有问题,卸载重装吧。

sudo apt purge 'postgresql.*' -y
sudo apt autoremove --purge -y
sudo apt install -y 'postgresql-9.6'

搞定
Reply View the author
deepinuser17
deepin
2018-05-06 10:56
#15
只有一个版本安装。

$ dpkg -l | grep postgresql
ii  postgresql                                             9.6+184                           all          object-relational SQL database (supported version)
ii  postgresql-9.6                                         9.6.3-4+b1                        amd64        object-relational SQL database, version 9.6 server
ii  postgresql-client-9.6                                  9.6.3-4+b1                        amd64        front-end programs for PostgreSQL 9.6
ii  postgresql-client-common                               184                               all          manager for multiple PostgreSQL client versions
ii  postgresql-common                                      184                               all          PostgreSQL database-cluster manager
ii  postgresql-contrib-9.6                                 9.6.3-4+b1                        amd64        additional facilities for PostgreSQL


# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sat 2018-05-05 11:40:37 PDT; 14min ago
  Process: 747 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 747 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/postgresql.service

重新安装是一个办法。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 14:21
#16
三台实体机,一台虚拟机,都是这种情况,重装也是这样。只是不能自动启动,手动用service postgresql能启动,一切正常,所以应该不是安装问题。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 14:28
#17
刚才在论坛搜了下,至少有两个人遇到了和我一样的问题。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 14:36
#18
目前我正在开源ERP系统中推广大家深度做为实施和开发环境,这个数据库不能自动启动是唯一不方便的地方,这个问题解决了,我至少可以拉300个开发人员到深度阵营。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 15:30
#19
安装了PostgreSQL10.0,可以开机启动。
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2018-05-06 20:12
#20
本帖最后由 fenshuajiang 于 2018-5-6 12:19 编辑

重装pg9.6不能解决问题,改用pg10了,不过这样安装pgadmin4又成了问题,和deepin有依赖冲突。

如果升级这个 libqt5core5a 到 5.7.0,会不会造成深度不稳定呢?
这个用来访问PostgreSQL10的pgadmin4对开发来讲还是很有用的。
Reply View the author
1 / 2
To page