Thread: Can't create lock file /tmp/.s.PGSQL.5432.lock

Can't create lock file /tmp/.s.PGSQL.5432.lock

From
Patrice Durosay
Date:
Hi all

Running postgres under RedHat9, I moved the /tmp partition to / and copied the /usr into a much larger one in order to
getmore disk space for programs . Hope I did not loose any file. 

One of the problems is that postgre dont start. I Followed the /etc/init.d/postgresql script. It crashes at the line

  su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p /usr/bin/postmaster -o '-p ${PGPORT}' start  "


with message

:FATAL:  Can't create lock file /tmp/.s.PGSQL.5432.lock: Permission denied

and the erroneous one

postmaster successfully started

I can understand that the user postgres:postgres cannot write in the /tmp directorythat belong to root:root (as usual),
butit worked before. 
A precision,  I have no .s.PGSQL.5432 file in the /tmp directory.

srwxrwxrwx    1 postgres postgres        0 Dec 11 14:01 ./.s.PGSQL.543


Have any suggestion so that I can rstart the postmaster ?
Should I reinstall postgresql and is it a great risk ?

Cordially

Patrice Durosay




Re: Can't create lock file /tmp/.s.PGSQL.5432.lock

From
Tom Lane
Date:
Patrice Durosay <patrice.durosay@cgm.cnrs-gif.fr> writes:
> Running postgres under RedHat9, I moved the /tmp partition to / and copied the /usr into a much larger one in order
toget more disk space for programs . Hope I did not loose any file. 

> :FATAL:  Can't create lock file /tmp/.s.PGSQL.5432.lock: Permission denied

You forgot to give the new /tmp directory the correct permissions.

            regards, tom lane

Re: Can't create lock file /tmp/.s.PGSQL.5432.lock

From
Bruno LEVEQUE
Date:
Hi

The right on /tmp must be : drwxrwxrwt and owner : root, group : root

Are they ?



Patrice Durosay wrote:

>Hi all
>
>Running postgres under RedHat9, I moved the /tmp partition to / and copied the /usr into a much larger one in order to
getmore disk space for programs . Hope I did not loose any file. 
>
>One of the problems is that postgre dont start. I Followed the /etc/init.d/postgresql script. It crashes at the line
>
>  su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p /usr/bin/postmaster -o '-p ${PGPORT}' start  "
>
>
>with message
>
>:FATAL:  Can't create lock file /tmp/.s.PGSQL.5432.lock: Permission denied
>
>and the erroneous one
>
>postmaster successfully started
>
>I can understand that the user postgres:postgres cannot write in the /tmp directorythat belong to root:root (as
usual),but it worked before. 
>A precision,  I have no .s.PGSQL.5432 file in the /tmp directory.
>
>srwxrwxrwx    1 postgres postgres        0 Dec 11 14:01 ./.s.PGSQL.543
>
>
>Have any suggestion so that I can rstart the postmaster ?
>Should I reinstall postgresql and is it a great risk ?
>
>Cordially
>
>Patrice Durosay
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>
>

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno.leveque@net6d.com
http://www.net6d.com



Re: Can't create lock file /tmp/.s.PGSQL.5432.lock

From
Patrice Durosay
Date:
Hello,

Many thanks to Bruno Leveque and Tom Lane for your sharp answers :

> You forgot to give the new /tmp directory the correct permissions.

> The right on /tmp must be : drwxrwxrwt and owner : root, group : root

My permissions were false
drwxr-xr-x

chmod 1777 /tmp

restored the right ones

drwxrwxrwt    6 root     root         1024 déc 19 10:56 tmp

postgresql starts, xfs also and certainly a lot of other problems are avoided

Cheers

Patrice