PostgreSQL failed to start

Hi,

I had an OpenNMS test install running with PostgreSQL until some PAT testers decided to pull the plug on it whilst it was running.

Unfortunately I cannot start my OpenNms install. This is because Postgresql will not start.

Doing: "service postgresql start" just brings up a "failed" message

Looking at my postgresql logs, i find the following;

FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster PID (2904) running in data directory "/var/lib/pgsql/data"?
FATAL: bogus data in lock file "postmaster.pid": ""

What can i do to resolve this? I have forced an fsck fisk check at boot and rebooted, but the problem still remains.

Thanks.
LVL 11
gmbaxterAsked:
Who is Participating?
 
james_owenConnect With a Mentor Commented:
# find / -type f -name "*postmater.pid*" 2>/dev/null

then delete the file... unclean exit may have left the pid file hanging around

0
 
NetExpert-WarszawaCommented:
Have you tried to delete postmaster.pid file?
0
 
james_owenCommented:
errr.. spelled "postmaster.pid" incorrectly...
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gmbaxterAuthor Commented:
No I haven't tried to delete the file. Is it an important file? What are the consequences if it doesn't recreate after being deleted?
0
 
NetExpert-WarszawaCommented:
This is just a file created each time a PostgreSQL server starts. By checking its existence the server knows if another instance is running already.
It is absolutely safe to delete it when the server is down.
0
 
james_owenCommented:
Pid files are often created by scripts by SA and developers to track the process id of certain programs... they are volatile as the next time the process starts it will very likely be given a new process ID.

if the postgresql service is stopped the PID is most definitely stale and therefore safe to delete.
0
 
gmbaxterAuthor Commented:
Thanks, this seems to have worked. Is there a GUI front end for postgresql so that I can easily schedule backups? similar to mysql gui tools ?
0
 
NetExpert-WarszawaCommented:
0
 
NetExpert-WarszawaCommented:
A standard tool for psql is pgAdmin III
0
All Courses

From novice to tech pro — start learning today.