Thread: Bug or ?

Bug or ?

From
Keary Suska
Date:
FYI, it appears that you cannot start the postmaster when your current
working directory is not accessible by the postgres user:

shell-init: could not get current directory: getcwd: cannot access parent
directories: Permission denied
LOG:  00000: could not identify current directory: Permission denied
LOCATION:  find_my_exec, exec.c:195
FATAL:  XX000: /usr/local/pgsql/bin/postmaster: could not locate my own
executable path
LOCATION:  PostmasterMain, postmaster.c:431

This seems new at least to 8.x. Don't know if there is OS involvement as
well. This issue doesn't appear to be documented, and I am not sure why PG
would want to use the current directory. Perhaps there is just some absent
error checking.

OS: Mac OS X 10.4.2
PG: 8.0.3

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


Re: Bug or ?

From
Tom Lane
Date:
Keary Suska <hierophant@pcisys.net> writes:
> FYI, it appears that you cannot start the postmaster when your current
> working directory is not accessible by the postgres user:

Is there a good reason that this case should work?  I don't think it's
very easy to fix given that we have to resolve the actual location
of the postmaster executable before we chdir to the data directory.
In any case, AFAICS this would only be an issue if you do
"su postgres -c postmaster" rather than "su -l postgres -c postmaster"
and the former is to be avoided for many reasons besides this one.

            regards, tom lane

Re: Bug or ?

From
Keary Suska
Date:
on 9/5/05 6:51 PM, tgl@sss.pgh.pa.us purportedly said:

>> FYI, it appears that you cannot start the postmaster when your current
>> working directory is not accessible by the postgres user:
>
> Is there a good reason that this case should work?  I don't think it's
> very easy to fix given that we have to resolve the actual location
> of the postmaster executable before we chdir to the data directory.

I'll have to take your word for it as I don't know enough to discuss why/why
not. It's just that this is the first time I have come across an executable
with this particular "restriction".

> In any case, AFAICS this would only be an issue if you do
> "su postgres -c postmaster" rather than "su -l postgres -c postmaster"
> and the former is to be avoided for many reasons besides this one.

I guess this becomes a bug report for the Darwin startup script in contrib,
which is broken not only because it does what you recommend against (above),
but it is also broken in other ways. How does one go about reporting this? I
am not sure who is responsible for contrib stuff.

Thanks,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


Re: Bug or ?

From
Tom Lane
Date:
Keary Suska <hierophant@pcisys.net> writes:
> on 9/5/05 6:51 PM, tgl@sss.pgh.pa.us purportedly said:
>> In any case, AFAICS this would only be an issue if you do
>> "su postgres -c postmaster" rather than "su -l postgres -c postmaster"
>> and the former is to be avoided for many reasons besides this one.

> I guess this becomes a bug report for the Darwin startup script in contrib,
> which is broken not only because it does what you recommend against (above),
> but it is also broken in other ways. How does one go about reporting this? I
> am not sure who is responsible for contrib stuff.

Whoever's using it ;-).  Feel free to send a patch to pgsql-patches.

            regards, tom lane