【问题标题】:Postgres No such interface 'org.freedesktop.DBus.Properties'Postgres 没有这样的接口 'org.freedesktop.DBus.Properties'
【发布时间】:2019-08-10 15:47:00
【问题描述】:

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

$ systemctl status 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 service postgresql start

* 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 守护进程

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 日志文件为空。

【问题讨论】:

    标签: postgresql ubuntu


    【解决方案1】:

    在 Ubuntu 14.04 上安装 snap 后我遇到了同样的错误。它是从 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
          ...
        }
    

    【讨论】:

    • 救命的答案就在这里,这将花费我无限的时间来弄清楚(完全相同的问题:我安装了 snap 并没有意识到它破坏了 postgres 初始化脚本)谢谢!
    • 如果有帮助,我们在将 Ubuntu ESM 更新应用到 14.04 LTS 主机后看到了这一点。
    • Bravo!,在 ec2 实例崩溃后 Postgres 损坏了。上述解决方案有助于修复它
    • 强制期限过后,您将获得 +500 回购赏金。非常感谢。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2018-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-23
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多