Postgres没有这样的接口'org.freedesktop.DBus.Properties'

时间:2019-03-20 01:56:58

标签: postgresql ubuntu

Postgres数据库重启后崩溃,尝试了几乎所有操作,包括重新安装postgres。它不会在ubuntu 14.04上启动

  

$ systemctl状态postgresql@9.6-main.service

Failed to issue method call: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/systemd1/unit/postgresql_409_2e6_2dmain_2eservice
  

$ pg_lsclusters

Ver Cluster Port Status Owner    Data directory               Log file
9.6 main    5432 down   postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log
  

$ sudo服务postgresql启动

* Starting PostgreSQL 9.6 database server                                                                                                                                  
* Failed to issue method call: Unit postgresql@9.6-main.service failed to 
load: No such file or directory. See system logs and 'systemctl status 
postgresql@9.6-main.service' for details.
  

$ ps uxa | grep dbus-daemon

message+   751  0.0  0.0  40812  4064 ?        Ss   18:39   0:03 dbus-daemon --system --fork
dominic   3058  0.0  0.0  40840  4252 ?        Ss   18:40   0:02 dbus-daemon --fork --session --address=unix:abstract=/tmp/dbus-S1LhlCDwl2
dominic   3145  0.0  0.0  39400  3536 ?        S    18:40   0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
dominic  17462  0.0  0.0  15956  2244 pts/4    S+   21:45   0:00 grep --color=auto dbus-daemon

Postgres日志文件为空。

2 个答案:

答案 0 :(得分:1)

Ubuntu 14.04尚未切换到systemd。我强烈建议升级到16.04或什至更好的18.04

答案 1 :(得分:1)

在Ubuntu 14.04上安装快照后,我遇到了相同的错误。它是从systemd安装了一些零件,并破坏了postgresql初始化脚本。

您需要将参数--skip-systemctl-redirect添加到文件/usr/share/postgresql-common/init.d-functions中的pg_ctlcluster中

您需要更改的功能:

    do_ctl_all() {
      ...
      # --skip-systemctl-redirect fix postgresql No such interface 'org.freedesktop.DBus.Properties'
      if [ "$1" = "stop" ] || [ "$1" = "restart" ]; then
        ERRMSG=$(pg_ctlcluster --skip-systemctl-redirect --force "$2" "$name" $1 2>&1)
      else
        ERRMSG=$(pg_ctlcluster --skip-systemctl-redirect "$2" "$name" $1 2>&1)
      fi
      ...
    }