0

I have been racking my brain on this issue, and probably have tried every possible solution ( fix, purge, reinstall), but postgresql doesn't start

rupin@linuxbox:~$ sudo /etc/init.d/postgresql restart
[sudo] password for rupin: 


Restarting PostgreSQL 10 database server 
Failed to issue method call: Unit postgresql@10-main.service failed to load: No such file or directory. See system logs and 'systemctl status postgresql@10-main.service' for details.   

The Log file is empty. There is no postmaster.pid file that could be to blame.

My Ubuntu Laptop crashed and the DB was active when the system crashed.

Can someone advise what I can do to fix this issue and start the server again?

**Update **

rupin@linuxbox:~$ systemctl status postgresql@10-main.service
Failed to issue method call: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/systemd1/unit/postgresql_4010_2dmain_2eservice





Rupin
  • 610
  • 7
  • 23

2 Answers2

0

Become OS user postgres.

Try to start PostgreSQL with

pg_ctl start -D /etc/postgres/10/main

(Use the path where postgresql.conf resides.)

Then you will see the error and you will know what to do about it.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • I cant seem to find that config file. I used locate postgresql.conf according to this post https://stackoverflow.com/questions/3602450/where-are-my-postgres-conf-files but the file is empty at location /usr/lib/tmpfiles.d/postgresql.conf – Rupin Aug 31 '19 at 04:06
  • I have added some more information to my original question. I also looked at https://askubuntu.com/questions/873091/postgresql-fails-to-reinstall-after-upgrading-ubuntu-12-04-to-14-04 and I dont see a file at path /usr/share/postgresql-common/init.d-functions. – Rupin Aug 31 '19 at 04:28
  • Then you probably removed your database. – Laurenz Albe Sep 02 '19 at 05:09
0

I followed the instructions of the answer from https://askubuntu.com/questions/873091/postgresql-fails-to-reinstall-after-upgrading-ubuntu-12-04-to-14-04

I ended up removing systemd

sudo apt-get purge systemd && sudo apt-get autoremove

And I was able to reinstall postgres. Unfortunately, I lost my data/cant trace it. It is okay for me, because it is my local DB

Rupin
  • 610
  • 7
  • 23