Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:   
   ...fail!

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 superuser.com May 6 at 1:56

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

2 Answers 2

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
UID        PID  PPID  C STIME TTY          TIME CMD
[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

 
discard

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.