Thread: System crashed: fatal error restarting postgres

System crashed: fatal error restarting postgres

From
Rich Shepard
Date:
   A java application threw a major error when closing and it crashed my
system (including wiping out most of /tmp). After rebooting I su'd to user
postgres and tried to start postgresql-9.5.4, but this error displays:

postgres@salmo:~$ FATAL:  could not open shared memory segment
"/PostgreSQL.1804289383": Permission denied

   Please advise me on how I proceed to clear this and restart the
application.

TIA,

Rich


Re: System crashed: fatal error restarting postgres

From
Adrian Klaver
Date:
On 09/30/2016 01:15 PM, Rich Shepard wrote:
>   A java application threw a major error when closing and it crashed my
> system (including wiping out most of /tmp). After rebooting I su'd to user
> postgres and tried to start postgresql-9.5.4, but this error displays:
>
> postgres@salmo:~$ FATAL:  could not open shared memory segment
> "/PostgreSQL.1804289383": Permission denied
>
>   Please advise me on how I proceed to clear this and restart the
> application.

See here:

https://www.postgresql.org/message-id/24208.1473724630%40sss.pgh.pa.us
>
> TIA,
>
> Rich
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: System crashed: fatal error restarting postgres

From
Tom Lane
Date:
Rich Shepard <rshepard@appl-ecosys.com> writes:
>    A java application threw a major error when closing and it crashed my
> system (including wiping out most of /tmp). After rebooting I su'd to user
> postgres and tried to start postgresql-9.5.4, but this error displays:

> postgres@salmo:~$ FATAL:  could not open shared memory segment
> "/PostgreSQL.1804289383": Permission denied

Wrong permissions on /dev/shm, perhaps?  On Linux I believe it should
always be

drwxrwxrwt. 2 root root 160 Sep 30 15:23 /dev/shm/

Although TBH, the first question you should be asking yourself is why
you're running *any* java application with root privileges, which is
what I think would be needed to let this happen.

            regards, tom lane


Re: System crashed: fatal error restarting postgres

From
Adrian Klaver
Date:
On 09/30/2016 01:15 PM, Rich Shepard wrote:
>   A java application threw a major error when closing and it crashed my
> system (including wiping out most of /tmp). After rebooting I su'd to user
> postgres and tried to start postgresql-9.5.4, but this error displays:
>
> postgres@salmo:~$ FATAL:  could not open shared memory segment
> "/PostgreSQL.1804289383": Permission denied
>
>   Please advise me on how I proceed to clear this and restart the
> application.

Actually more to the point:

https://www.postgresql.org/message-id/alpine.LNX.2.11.1609121701270.1140%40localhost
>
> TIA,
>
> Rich
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: System crashed: fatal error restarting postgres [FIXED]

From
Rich Shepard
Date:
On Fri, 30 Sep 2016, Adrian Klaver wrote:

> See here:
> https://www.postgresql.org/message-id/24208.1473724630%40sss.pgh.pa.us

   Ah, shoot! I completely forgot about this. Yes, I reset the perms on
/dev/shm and that fixed the problem.

My apologies to all,

Rich


Re: System crashed: fatal error restarting postgres

From
Rich Shepard
Date:
On Fri, 30 Sep 2016, Tom Lane wrote:

> Wrong permissions on /dev/shm, perhaps?

Tom,

   Yes. I keep forgetting about this since I don't reboot this
server/workstation often.

Thanks,

Rich


Re: System crashed: fatal error restarting postgres

From
Tom Lane
Date:
Rich Shepard <rshepard@appl-ecosys.com> writes:
> On Fri, 30 Sep 2016, Tom Lane wrote:
>> Wrong permissions on /dev/shm, perhaps?

>    Yes. I keep forgetting about this since I don't reboot this
> server/workstation often.

You ought to do some investigation and figure out what is causing
it to come up with the wrong permissions in the first place; that
is certainly not normal Linux behavior.

Or at least stick a chmod into /etc/rc.d/rc.local, if you just
want to hit the problem over the head with a hammer.

            regards, tom lane