Results 1 to 8 of 8

Thread: Postgresql service not starting

  1. #1
    Join Date
    2013-Dec
    Posts
    15

    Postgresql service not starting

    Hi,

    postgresql 9.1 service is not starting for me... I have installed Kali 64 on my External HD...after unplugging the external hd before shutting down kali...postgresql is giving me error - it is not able to start...I cant use armitage, metasploit is loading but database slow...

    I have tried : apt-get update ; update postgresql ; enable postgresql at start up and metasploit ; service postgresql start ...stopping is OK... ;

    Can I uninstall postgresql and install again...?

    Please help me...

  2. #2
    Could you share the log file(s)?

    Code:
    cat /var/log/postgresql/*
    
    cat /var/log/syslog | grep -i postgres
    
    cat /var/log/messages | grep -i postgres

  3. #3
    Join Date
    2013-Dec
    Posts
    15
    Gotmilk, thank you for your interest....what I did now is...I deleted the original postgresql file which came with kali and installed the new 9.3v Graphicall...this is what I get now...-


    ~# service postgresql-9.3 status
    pg_ctl: server is running (PID: 2708)
    /etc/bin/postgres "-D" "/etc/data"
    -----------------------------------------------------------------------------------
    service postgresql-9.3 start
    Starting PostgreSQL 9.3:
    pg_ctl: another server might be running; trying to start server anyway
    waiting for server to start........
    pg_ctl: this data directory appears to be running a pre-existing postmaster
    stopped waiting
    pg_ctl: could not start server
    Examine the log output.
    PostgreSQL 9.3 did not start in a timely fashion, please see /etc/data/pg_log/startup.log for details

    ------------------------------------------------------------------------------------------------------------------------------------
    2013-12-03 08:17:32 GMT LOG: redirecting log output to logging collector process
    2013-12-03 08:17:32 GMT HINT: Future log output will appear in directory "pg_log".
    2013-12-03 08:21:27 GMT FATAL: lock file "postmaster.pid" already exists
    2013-12-03 08:21:27 GMT HINT: Is another postmaster (PID 6865) running in data directory "/etc/data"?
    2013-12-03 08:31:32 GMT FATAL: lock file "postmaster.pid" already exists
    2013-12-03 08:31:32 GMT HINT: Is another postmaster (PID 6865) running in data directory "/etc/data"?
    2013-12-03 16:45:55 GMT LOG: redirecting log output to logging collector process
    2013-12-03 16:45:55 GMT HINT: Future log output will appear in directory "pg_log".
    2013-12-03 17:55:11 GMT FATAL: lock file "postmaster.pid" already exists
    2013-12-03 17:55:11 GMT HINT: Is another postmaster (PID 2708) running in data directory "/etc/data"?

    ------------------------------------ARMITAGE AND METASPLOIT----------------------------------------

    :~# msfconsole
    [-] Failed to connect to the database: FATAL: password authentication failed for user "msf3"

    - No idea where the msf3 came from- it was only "msf" before
    .

    MAny thx in advance

  4. #4
    Quote Originally Posted by christopher777 View Post
    what I did now is...I deleted the original postgresql file which came with kali and installed the new 9.3v Graphicall...this is what I get now...-
    From the sounds of this, that wasn't wise. How did you 'delete' it?
    Just rm -rf the file(s)? Did you remove the package(s)? What command(s) did you use?



    Moving that aside, looking at the output:
    2013-12-03 08:21:27 GMT FATAL: lock file "postmaster.pid" already exists
    2013-12-03 08:21:27 GMT HINT: Is another postmaster (PID 6865) running in data directory "/etc/data"?
    And from your first post:
    after unplugging the external hd before shutting down
    My guess would be there is a old PID file, that hasn't been removed. As a result, postgresql always things there already a copy of itself running.
    I'm not sure where '/etc/data' has come from.



    Because I cant be sure with what you have done fully to postgresql (and how you installed it). I can't be 100% in my next suggestion.



    Below is me starting up postgresql, checking its running (twice), locating the PID file and checking to see if it have a '/etc/data/' folder like in your output (which is mentioned in your output).

    Code:
    root@kali-offsec ~$ service postgresql start
    [ ok ] Starting PostgreSQL 9.1 database server: main.
    root@kali~$ service postgresql status
    Running clusters: 9.1/main 
    root@kali~$ ps aux | grep postgresql
    root     10641  0.0  0.0   3484   768 pts/10   S+   09:48   0:00 grep postgresql
    postgres 31126  0.0  0.7  45144  7408 ?        S    07:53   0:00 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
    root@kali~$ find / -name postmaster.pid
    /var/lib/postgresql/9.1/main/postmaster.pid
    root@kali~$ ls /etc/data/
    ls: cannot access /etc/data/: No such file or directory
    root@kali~$


    My first suggestion would be to remove whatever you have done to postgresql, and restore the repo version (you may run into package dependencies issue later when you try and upgrade). After that, be 100% sure that postgresql isn't already running and then remove the PID file.
    Last edited by g0tmi1k; 2013-12-05 at 09:54.

  5. #5
    Join Date
    2013-Dec
    Posts
    15
    Gotmilk, ...No i just deleted the folders and files which I saw in etc and init.d... I can not find the old file.

    MAny thanx for your help anyway...

    HOw do i restore the original files...?

  6. #6
    Quote Originally Posted by christopher777 View Post
    Gotmilk, ...No i just deleted the folders and files which I saw in etc and init.d... I can not find the old file.

    MAny thanx for your help anyway...

    HOw do i restore the original files...?
    You can't restore them as you deleted them.

    Best bet is going to be do a fresh install.

  7. #7
    Join Date
    2013-Dec
    Posts
    15
    ...finally fixed issue... reinstall metasploit and armitage

  8. #8
    Join Date
    2014-Jan
    Posts
    3
    how to remove postgresql?

Similar Threads

  1. Postgresql service wont start after reboot.
    By kalipi2 in forum ARM Archive
    Replies: 0
    Last Post: 2015-05-24, 09:28
  2. Kali on AWS - service postgresql start issue
    By 2bitwannabe in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2014-03-05, 01:52
  3. Failed #service postgresql start
    By Castor_Troy in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2013-06-25, 00:39

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •