Postgres database crashed after restart, tried just about everything including reinstalling postgres. It will not start on ubuntu 14.04,
$ systemctl status [email protected]
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 [email protected] failed to 
load: No such file or directory. See system logs and 'systemctl status 
[email protected]' 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 log file is empty.
I had the same error after install snap on Ubuntu 14.04. It was install some parts from systemd and broke postgresql init script.
You need to add parameter --skip-systemctl-redirect to pg_ctlcluster in file /usr/share/postgresql-common/init.d-functions
The function you need to change:
    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
      ...
    }
                        Ubuntu 14.04 did not switch to systemd yet. I highly recommend upgrading to 16.04 or even better, 18.04.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With