Re: BUG #15265: The program "initdb" is needed by pg_ctl but was notfound in the same directory as "pg_ctl". - Mailing list pgsql-bugs

From Mohammed Shahid Nawaz
Subject Re: BUG #15265: The program "initdb" is needed by pg_ctl but was notfound in the same directory as "pg_ctl".
Date
Msg-id CAG5wiRznpn99x_AmymU9x+E6jh1zBB+QOkOXMRuW+fCz4JMfqA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15265: The program "initdb" is needed by pg_ctl but was not found in the same directory as "pg_ctl".  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15265: The program "initdb" is needed by pg_ctl but was notfound in the same directory as "pg_ctl".
List pgsql-bugs
Hi Tom,
Thanks for the quick response.
The same build and, the same command works fine on a non-root user. 
Since, this time i am running from a root login, the command i use is as follows.
su - shahid -c '/root/pgsql10x/bin/pg_ctl -D /root/pgsql10x/data/ initdb'

The bin folder has 777 permission with the owner being shahid here.
If you see my post I have shared the ls-lrt output for reference.

I have been using the same command for my earlier 9.6.3 version of build, and it worked without any trouble.

Thanks again,
Mohammed Shahid Nawaz



On Sat 7 Jul, 2018, 1:32 AM Tom Lane, <tgl@sss.pgh.pa.us> wrote:
PG Bug reporting form <noreply@postgresql.org> writes:
> sudo -u shahid ./pg_ctl -D /root/pgsql10x/data/ initdb
> invalid binary "/root/pgsql10x/bin/pg_ctl"

I think you would get that error if pg_ctl is unable to stat itself,
which might be due to a permissions problem.  Are you sure the shahid
user can read/exec all the directories in that path (particularly /root)?

                        regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Incorrect interpretation of time zone "Africa/Sao_Tome" on PG9.6?
Next
From: Peter Eisentraut
Date:
Subject: Re: long analyze, libc bug and libicu