Postgresql is not running. It's active but exited
Postgresql is not running.
Versions
PostgreSQL Version: 10.12
Distro: Linux Mint 19.3 (Tricia)/Ubuntu 18.04
Not working:
$ sudo service postgresql restart
$ sudo systemctl restart postgresql
systemctl status postgresql:
╭─root@danial /opt
╰─➤ systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2020-07-13 22:52:54 +03; 9min ago
Process: 22887 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 22887 (code=exited, status=0/SUCCESS)
Jul 13 22:52:54 17-V13-5 systemd[1]: Starting PostgreSQL RDBMS...
Jul 13 22:52:54 17-V13-5 systemd[1]: Started PostgreSQL RDBMS.
ss -nlp | grep postgre
u_str LISTEN 0 128 /var/run/postgresql/.s.PGSQL.5432 188329 * 0 users:(("postgres",pid=22869,fd=8))
tcp LISTEN 0 128 127.0.0.1:5432 0.0.0.0:*
pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
ps ax | grep -i postgresq
1495 ? S 0:00 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
systemctl status [email protected]
● [email protected] - PostgreSQL Cluster 10.12-main
Loaded: loaded (/lib/systemd/system/[email protected]; indirect; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Wed 2020-07-15 07:20:02 +03; 51s ago
The postgresql.service
systemd unit used as a top level grouping service, that does nothing than starting and sopping other services that depend on it.
As it implemented as service, it required to have a dummy ExecStart:
ExecStart=/bin/true
RemainAfterExit=on
You can examine that by running
systemctl cat postgresql.service
However (unfortunately), it's own status says nothing about services that depend on in. It just tells you that postgresql.service
have been started and depending services requested to start.