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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NetExpert-WarszawaCommented:
Have you tried to delete postmaster.pid file?
0
james_owenCommented:
# find / -type f -name "*postmater.pid*" 2>/dev/null

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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
james_owenCommented:
errr.. spelled "postmaster.pid" incorrectly...
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.