当我检查服务状态时,它似乎正在运行:
ubuntu@demos:/etc/postgresql/10/main$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2020-03-11 09:11:44 UTC; 3min 28s ago
Process: 18643 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 18643 (code=exited, status=0/SUCCESS)
Mar 11 09:11:44 demos systemd[1]: Starting PostgreSQL RDBMS...
Mar 11 09:11:44 demos systemd[1]: Started PostgreSQL RDBMS.
但是当我查看进程列表时......
ubuntu@demos:/etc/postgresql/10/main$ ps aux | grep 18643
ubuntu 18811 0.0 0.2 14856 996 pts/7 S+ 09:16 0:00 grep --color=auto 18643
没什么。
尝试重新启动 postgresql 服务似乎也无法解决问题。
尝试查看/var/log/postgresql/postgresql-10-main.log
但该文件似乎是空的。
我也跑了journalctl -u postgresql.service
,这就是我看到的:
Feb 08 15:38:30 demos systemd[1]: Started PostgreSQL RDBMS.
Mar 11 09:06:24 demos systemd[1]: Stopped PostgreSQL RDBMS.
Mar 11 09:06:24 demos systemd[1]: Stopping PostgreSQL RDBMS...
Mar 11 09:06:24 demos systemd[1]: Starting PostgreSQL RDBMS...
Mar 11 09:06:24 demos systemd[1]: Started PostgreSQL RDBMS.
Mar 11 09:11:36 demos systemd[1]: Stopped PostgreSQL RDBMS.
Mar 11 09:11:44 demos systemd[1]: Starting PostgreSQL RDBMS...
Mar 11 09:11:44 demos systemd[1]: Started PostgreSQL RDBMS.
Mar 11 09:17:18 demos systemd[1]: Stopped PostgreSQL RDBMS.
Mar 11 09:17:18 demos systemd[1]: Stopping PostgreSQL RDBMS...
Mar 11 09:17:18 demos systemd[1]: Starting PostgreSQL RDBMS...
Mar 11 09:17:18 demos systemd[1]: Started PostgreSQL RDBMS.