A great linux stuff website

Monthly Archives: August 2013

root@server [~]# /etc/init.d/postgresql status
postmaster dead but pid file exists

==========================

Above error getting after restart the postgresql.

Possible solution to check below steps:

1. try to stop and restart postgresql
/etc/init.d/postgresql start
Starting postgresql service: [FAILED

2. check the logs for postgresql under below log file

# /var/lib/pgsql/data/pg_log (This directory stored the all postgresql logs file)
# ls -l

-rw——- 1 postgres postgres 5546 Aug 2 15:40 postgresql-Fri.log
-rw——- 1 postgres postgres 182 Jul 29 01:59 postgresql-Mon.log
-rw——- 1 postgres postgres 212 Jul 27 02:02 postgresql-Sat.log
-rw——- 1 postgres postgres 152 Jul 28 01:58 postgresql-Sun.log
-rw——- 1 postgres postgres 122 Aug 1 02:03 postgresql-Thu.log
-rw——- 1 postgres postgres 152 Jul 30 01:59 postgresql-Tue.log
-rw——- 1 postgres postgres 212 Jul 31 02:03 postgresql-Wed.log

# check the latest log file for the same logs error below:
cat or tail postgresql-Mon.log

LOG: shutting down
LOG: database system is shut down
LOG: invalid IP mask “md5”: Name or service not known
CONTEXT: line 76 of configuration file “/var/lib/pgsql/data/pg_hba.conf”
LOG: invalid IP mask “md5”: Name or service not known
CONTEXT: line 77 of configuration file “/var/lib/pgsql/data/pg_hba.conf”
FATAL: could not load pg_hba.conf
LOG: database system was shut down at 2013-08-02 15:39:39 GMT
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

Above error will show the issue with /var/lib/pgsql/data/pg_hba.conf file

3. check the /var/lib/pgsql/data/pg_hba.conf and add the proper remote IP’s in correct format like below e.g (at the end of file)

host all all 192.xx.12.xx3 255.255.255.255 md5

A record can have one of the seven formats

local database user auth-method [auth-option]
host database user CIDR-address auth-method [auth-option]
hostssl database user CIDR-address auth-method [auth-option]
hostnossl database user CIDR-address auth-method [auth-option]
host database user IP-address IP-mask auth-method [auth-option]
hostssl database user IP-address IP-mask auth-method [auth-option]
hostnossl database user IP-address IP-mask auth-method [auth-option]

4. Restart Postgresql
# root@server []# /etc/init.d/postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]

Done!
Issue fixed 🙂

Advertisements