Thread: Server crashed, now cannot start postgres

Server crashed, now cannot start postgres

From
Rich Shepard
Date:
   Tried to compile 3 large programs at one time and the CPU overheated,
shutting down the server. Now when I try to start postgres-9.5.4 (as the
superuser, postgres) I get this result:

postgres@salmo:~$ postgres -D /var/lib/pgsql/9.5/data/ &
[1] 14544
postgres@salmo:~$ FATAL:  could not open shared memory segment
"/PostgreSQL.1804289383": Permission denied

   Not before encountering this problem I've no idea where to look to see how
to fix it. Please advise.

TIA,

Rich


Re: Server crashed, now cannot start postgres

From
Tom Lane
Date:
Rich Shepard <rshepard@appl-ecosys.com> writes:
>    Tried to compile 3 large programs at one time and the CPU overheated,
> shutting down the server. Now when I try to start postgres-9.5.4 (as the
> superuser, postgres) I get this result:

> postgres@salmo:~$ postgres -D /var/lib/pgsql/9.5/data/ &
> [1] 14544
> postgres@salmo:~$ FATAL:  could not open shared memory segment
> "/PostgreSQL.1804289383": Permission denied

A look at the code suggests this is shm_open() returning EACCES.
Not sure why that's happening.  If this is a Linux box, maybe the
permissions on /dev/shm are bollixed?

As a temporary workaround, you could probably set
dynamic_shared_memory_type = none in postgresql.conf (I'm assuming
it's set to posix now).  I do not think that disables any very
critical functionality in 9.5, but it's a hack not a solution.

            regards, tom lane


Re: Server crashed, now cannot start postgres [FIXED]

From
Rich Shepard
Date:
On Mon, 12 Sep 2016, Tom Lane wrote:

> A look at the code suggests this is shm_open() returning EACCES. Not sure
> why that's happening. If this is a Linux box, maybe the permissions on
> /dev/shm are bollixed?

Tom,

   Yes, it's a linux box. And /dev/shm/ does have incorrect permissions
(755). Thanks to your response I remembered that chromium does not run until
I follow its advice to chmod 1777 /dev/shm. Sure enough, chromium would not
load.

   So, I changed the perms on /dev/shm/ and now both postgres and chromium
work.

Very much appreciated,

Rich


Re: Server crashed, now cannot start postgres [FIXED]

From
Tom Lane
Date:
Rich Shepard <rshepard@appl-ecosys.com> writes:
>    Yes, it's a linux box. And /dev/shm/ does have incorrect permissions
> (755). Thanks to your response I remembered that chromium does not run until
> I follow its advice to chmod 1777 /dev/shm. Sure enough, chromium would not
> load.
>    So, I changed the perms on /dev/shm/ and now both postgres and chromium
> work.

Hmm, AFAIK that's what it should be out of the box.  Certainly on my RHEL6
machine I see

$ ls -ld /dev/shm
drwxrwxrwt. 2 root root 260 Sep 12 10:53 /dev/shm/

Googling suggests that some really old kernels (~2009) might've had issues
with setting this up wrong, but anything in current support ought to
get it right ...

            regards, tom lane


Re: Server crashed, now cannot start postgres [FIXED]

From
Rich Shepard
Date:
On Mon, 12 Sep 2016, Tom Lane wrote:

> Hmm, AFAIK that's what it should be out of the box. Certainly on my RHEL6
> machine I see

   Until I make the time to upgrade this host from Slackware-14.1 to -14.2
the kernel is 3.10.17-smp.

Rich