Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I recently installed kali Linux and keep getting an error code starting metasploit this is the code

[...] Starting PostgreSQL 9.1 database server: main
[...] Error: could not exec /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -l /var/log/postgresql/postgresql-9.1-main.log -s -[FAILconfig_file="/etc/postgresql/9.1/main/postgresql.conf": ... failed!
failed!

Would really appreciate a solution been stuck for awhile.

share|improve this question

1 Answer 1

This thread had the same issue as yours and the OP provides how they were able to resolve it. The thread was titled: Server 9.1 doesn't restart and no output/log - data files seem corrupted.

excerpt

I managed to solve the problem.

For the record, I did the following:

 $ mkdir -p ~/postgresql/{etc,lib,log} 
 $ cp -a /etc/postgresql/9.1/main ~/postgresql/etc/old-install 
 $ cp -a /var/lib/postgresql/9.1/main ~/postgresql/lib/old-install 
 $ cp -a /var/log/postgresql ~/postgresql/log/old-install 

 $ apt-get remove --purge postgresql-9.1 postgresql-client-9.1 \
    postgresql-client-common postgresql-common 
 $ rm -rf /etc/postgresql 
 $ rm -rf /var/lib/postgresql 

 $ apt-get install postgresql 
 $ service postgresql stop 

 $ cp -a /etc/postgresql/9.1/main ~/postgresql/etc/new-install 
 $ cp -a /var/lib/postgresql/9.1/main ~/postgresql/lib/new-install 

 $ rm -rf /var/lib/postgresql/9.1/main 
 $ cp -a ~/postgresql/lib/old-install /var/lib/postgresql/9.1/main 
 $ su postgres -c '/usr/lib/postgresql/9.1/bin/pg_resetxlog \
    -f /var/lib/postgresql/9.1/main' 

I edited /etc/postgresql/9.1/main/postgresql.conf

 $ service postgresql start 

And it worked :-)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.