I had to reinstall postgres almost 5 times, but still with no success. The port just doesn't seem to listen to 5432. 

Whenever I type 

```
systemctl list-dependencies postgresql

```

I see it like that

```
● ├─postgresql@10-main.service
● ├─system.slice
● └─sysinit.target
●   ├─apparmor.service
●   ├─dev-hugepages.mount
●   ├─dev-mqueue.mount
●   ├─keyboard-setup.service
●   ├─kmod-static-nodes.service
●   ├─plymouth-read-write.service
●   ├─plymouth-start.service
●   ├─proc-sys-fs-binfmt_misc.automount
●   ├─setvtrgb.service
●   ├─sys-fs-fuse-connections.mount
●   ├─sys-kernel-config.mount
●   ├─sys-kernel-debug.mount
●   ├─systemd-ask-password-console.path
●   ├─systemd-binfmt.service
●   ├─systemd-hwdb-update.service
●   ├─systemd-journal-flush.service
●   ├─systemd-journald.service
●   ├─systemd-machine-id-commit.service
●   ├─systemd-modules-load.service
●   ├─systemd-random-seed.service
●   ├─systemd-sysctl.service
●   ├─systemd-timesyncd.service
●   ├─systemd-tmpfiles-setup-dev.service
●   ├─systemd-tmpfiles-setup.service
●   ├─systemd-udev-trigger.service
●   ├─systemd-udevd.service
●   ├─systemd-update-utmp.service
●   ├─cryptsetup.target
●   ├─local-fs.target
●   │ ├─-.mount
●   │ ├─boot-efi.mount
●   │ ├─systemd-fsck-root.service
●   │ └─systemd-remount-fs.service
●   └─swap.target
●     └─swapfile.swap

```

With a red circle next to `postgresql@10-main.service`. However, if I execute 

```
sudo /etc/init.d/postgresql status

```

I get the following output:

```
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2019-11-21 15:19:29 +05; 5min ago
  Process: 24403 ExecReload=/bin/true (code=exited, status=0/SUCCESS)
  Process: 24368 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 24368 (code=exited, status=0/SUCCESS)

systemd[1]: Starting PostgreSQL RDBMS...
systemd[1]: Started PostgreSQL RDBMS.
systemd[1]: Reloading PostgreSQL RDBMS.
systemd[1]: Reloaded PostgreSQL RDBMS.

```

And then If I run 

```
netstat -tulpn | grep :5432

```

There's no output. Same goes for `service postgresql start`

I can't find the process with PID 24368 using `sudo lsof -i -P -n`

What's the problem?

**EDIT**

While installing postgres I noticed the following output

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

```

With latter line red-highlighted. What is that?

BTW, both folders are empty, I can't check what's in these files

**EDIT**

Finally, after executing `systemctl status postgresql@10-main.service`

I see

```
    ● postgresql@10-main.service - PostgreSQL Cluster 10-main
       Loaded: loaded (/lib/systemd/system/postgresql@.service; disabled; vendor preset: enabled)
       Active: failed (Result: protocol) since Thu 2019-11-21 15:04:20 +05; 58min ago
    Condition: start condition failed at Thu 2019-11-21 15:57:01 +05; 5min ago
               └─ ConditionPathExists=/etc/postgresql/10/main/postgresql.conf was not met

systemd[1]: Starting PostgreSQL Cluster 10-main...
postgresql@10-main[22146]: Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l
postgresql@10-main[22146]: 2019-11-21 15:04:20.265 +05 [22151] FATAL:  private key file "/etc/ssl/private/ssl-cert-snakeoil.key" must be owne
postgresql@10-main[22146]: 2019-11-21 15:04:20.265 +05 [22151] LOG:  database system is shut down
postgresql@10-main[22146]: pg_ctl: could not start server
postgresql@10-main[22146]: Examine the log output.
systemd[1]: postgresql@10-main.service: Can't open PID file /var/run/postgresql/10-main.pid (yet?) after start: No such file or directory
systemd[1]: postgresql@10-main.service: Failed with result 'protocol'.
systemd[1]: Failed to start PostgreSQL Cluster 10-main.

```