Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server which was happily running PostgreSQL, until a crash this morning. Trying to restart Postgres, but it fails:

sudo /etc/init.d/postgresql start   
Starting PostgreSQL 9.1 database server
Removed stale pid file.    
The PostgreSQL server failed to start. Please check the log output:!

Doing tail /var/log/postgresql/postgresql-9.1-main.log, I see several messages from before it crashed -- but no output from the restart. The older messages say:

UTC WARNING: pgstat wait timeout   

OS: Ubuntu 12.04.3

share|improve this question

migrated from May 6 '14 at 1:56

This question came from our site for computer enthusiasts and power users.

For folks who might have the same problem.

I betcha you had a stuck shared memory segment.

Here we show our shared memory segments. Postgres has a big one for shared_buffers. This user can be different for different builds, some use "pgsql"

[root@host~]#  ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0xf90007aa 0          root       600        222        1
0x0052e2c1 32769      postgres   600        6602235904 95

MAKE SURE YOUR SERVER IS REALLY DOWN FIRST! Check the "nattch" which is the number of attached processes. Check for any running postgres/pgsql processes.

[root@host ~]# ps -fu postgres
[root@host ~]# 

Nothing, that's good. Now, you can remove the shared memory segment

ipcrm -m 32769

Rebooting works too, but we don't like to do that :-)

share|improve this answer

Rebooting the server seems to have fixed it.

share|improve this answer

Your Answer


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.