Thread: Postgres service is not running

Postgres service is not running

From
Jose Herrera
Date:
Hello, i have a problem with my PostgreSQL installation, i cannot make the service get running

The postgres service status its the following:
   postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
   Active: active (exited) since vie 2017-12-08 13:09:05 CST; 1h 43min ago
   Process: 813 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 813 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/postgresql.service

As you can see the service its active(exited), not running, and the PID its not present on the list of processes when i run ps -A.
I have tried with apt repository installations of Postgresql versions 9.5, 9.6, 10 and with EnterpriseDB installer and still got this error.
I have read that it has to be a postgres fault with the systemd integration of the OS, but i have tried many solutions and nothing seems to work.

Re: Postgres service is not running

From
Christoph Berg
Date:
Re: Jose Herrera 2017-12-13 <CACwLt51TYvOfycBpEwRi71GKTNx=k2RKo-Ts0f2XsgwGUE9h0w@mail.gmail.com>
> The postgres service status its the following:
>    postgresql.service - PostgreSQL RDBMS
>    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor
> prese
>    Active: active (exited) since vie 2017-12-08 13:09:05 CST; 1h 43min ago
>    Process: 813 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>    Main PID: 813 (code=exited, status=0/SUCCESS)
>    CGroup: /system.slice/postgresql.service
> 
> As you can see the service its active(exited), not running, and the PID its
> not present on the list of processes when i run *ps -A*.
> I have tried with apt repository installations of Postgresql versions 9.5,
> 9.6, 10 and with EnterpriseDB installer and still got this error.
> I have read that it has to be a postgres fault with the systemd integration
> of the OS, but i have tried many solutions and nothing seems to work.

Hi,

postgresql.service is only a stub that bundles the actual instances
which are called like postgresql@10-main.service. If you look that
their status, you'll see the actual postgres processes:

● postgresql@10-main.service - PostgreSQL Cluster 10-main
   Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect; vendor preset: enabled)
   Active: active (running) since Thu 2017-12-14 13:41:57 CET; 218ms ago
  Process: 18597 ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast 10-main stop (code=exited,
status=0/SUCCESS)
  Process: 4919 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 10-main start (code=exited,
status=0/SUCCESS)
 Main PID: 4924 (postgres)
    Tasks: 8 (limit: 4915)
   CGroup: /system.slice/system-postgresql.slice/postgresql@10-main.service
           ├─4924 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c
config_file=/etc/postgresql/10/main/postgresql.conf
           ├─4926 postgres: 10/main: checkpointer process
           ├─4927 postgres: 10/main: writer process
           ├─4928 postgres: 10/main: wal writer process
           ├─4929 postgres: 10/main: autovacuum launcher process
           ├─4930 postgres: 10/main: archiver process
           ├─4931 postgres: 10/main: stats collector process
           └─4932 postgres: 10/main: bgworker: logical replication launcher

Christoph


Re: Postgres service is not running

From
Christoph Berg
Date:
Re: Jose Herrera 2017-12-18 <5a3829fe.57a21f0a.19b12.c67f@mx.google.com>
> Thank you, then its normal that the postgresql.service status its active
> (exited)?

Yes, because postgresql.service is really just running /bin/true.
(It should actually be postgresql.target, but targets don't support
reloading yet.)

Christoph