pidfile location missing after restarting crashed server in 8.1

Started by Robert Treatabout 20 years ago6 messages
#1Robert Treat
xzilla@users.sourceforge.net

Fair warning this was in 8.1beta1 so perhaps this is fixed already.

postgres@phppgadmin:~$ ./start80.sh
pg_ctl: another postmaster may be running; trying to start postmaster anyway
FATAL: pre-existing shared memory block (key 5480001, ID 4063233) is still in
use
HINT: If you're sure there are no old server processes still running, remove
the shared memory block with the command "ipcrm", or just delete the file
"/usr/local/pgsql/data/80/postmaster.pid".
pg_ctl: could not start postmaster
Examine the log output.

postgres@phppgadmin:~$ ./start81.sh
pg_ctl: another postmaster may be running; trying to start postmaster anyway
FATAL: pre-existing shared memory block (key 5481001, ID 4030464) is still in
use
HINT: If you're sure there are no old server processes still running, remove
the shared memory block with the command "ipcclean", "ipcrm", or just delete
the file "postmaster.pid".
pg_ctl: could not start postmaster
Examine the log output.

the difference being that in 8.0 we printed the full path of the pid file, in
8.1 we do not. there could be a good reason for this, but istm that if we
can detect that a pid file is in our way, we should know its path.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Treat (#1)
Re: pidfile location missing after restarting crashed server in 8.1

Robert Treat <xzilla@users.sourceforge.net> writes:

the difference being that in 8.0 we printed the full path of the pid file, in
8.1 we do not. there could be a good reason for this,

Yeah: it's now being accessed by a relative path (relative to $PGDATA,
which we have already chdir'd into at this point).

regards, tom lane

#3Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#2)
Re: pidfile location missing after restarting crashed server in 8.1

Tom Lane wrote:

Robert Treat <xzilla@users.sourceforge.net> writes:

the difference being that in 8.0 we printed the full path of the pid file, in
8.1 we do not. there could be a good reason for this,

Yeah: it's now being accessed by a relative path (relative to $PGDATA,
which we have already chdir'd into at this point).

So we should include PGDATA in the error message (DataDir actually, I
guess).

--
Alvaro Herrera Architect, http://www.EnterpriseDB.com
"When the proper man does nothing (wu-wei),
his thought is felt ten thousand miles." (Lao Tse)

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: pidfile location missing after restarting crashed server in 8.1

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Tom Lane wrote:

Yeah: it's now being accessed by a relative path (relative to $PGDATA,
which we have already chdir'd into at this point).

So we should include PGDATA in the error message (DataDir actually, I
guess).

I don't think that follows. The code prints exactly the path name it's
using to access the file, and I think that's exactly what it should
print. Are we going to editorialize similarly on every other message
that includes a file name?

regards, tom lane

#5Robert Treat
xzilla@users.sourceforge.net
In reply to: Tom Lane (#2)
Re: pidfile location missing after restarting crashed server in 8.1

On Wednesday 26 October 2005 14:59, Tom Lane wrote:

Robert Treat <xzilla@users.sourceforge.net> writes:

the difference being that in 8.0 we printed the full path of the pid
file, in 8.1 we do not. there could be a good reason for this,

Yeah: it's now being accessed by a relative path (relative to $PGDATA,
which we have already chdir'd into at this point).

I thought about this, but it didn't seem to me this would actually prevent us
from explicitly stating the full path to the pid file, just make an extra
hoop we would have to go to. ISTM the helpfulness of the information and the
fact that we are in a fatal startup mode would make it worth it.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

#6Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#4)
Re: pidfile location missing after restarting crashed server in 8.1

Tom Lane wrote:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Tom Lane wrote:

Yeah: it's now being accessed by a relative path (relative to $PGDATA,
which we have already chdir'd into at this point).

So we should include PGDATA in the error message (DataDir actually, I
guess).

I don't think that follows. The code prints exactly the path name it's
using to access the file, and I think that's exactly what it should
print.

It's not useful for the user that way. Besides, we know what we did
chdir() to, so we could present that information to the user.

--
Alvaro Herrera
"Amanece. (Ignacio Reyes)
El Cerro San Crist�bal me mira, c�nicamente, con ojos de virgen"