0

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

2 Answers 2

1

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 :-)

0

Rebooting the server seems to have fixed it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .