Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)

Lists: pgsql-general
From: Jarkko Elfving <jarelf(at)ebaana(dot)net>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)
Date: 2005-01-23 06:09:15
Message-ID: 1106460555.3195.22.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi again...

I tried to solve my PostgreSQL cluster problem like Michael Fuhr and
Lonni Friedman helps me, but I didn't get it work. So I figured out that
if I do an fresh installation and removed the PostgreSQL completely
(even those JDBC and PL -drivers - everything) and be sure that it is
completely removed. Then I installed it again with rpm -Uhv command and
start to proceed like the manuals tells me, but now I'm in dead-end:
initdb fails because postgres program was not found. How this could be
happened? I did not removed the postgres user because I thought that is
not needed to do. Initdb returns following fail:

# su postgres
bash-3.00$ initdb -D=/var/lib/pgsql/data/
fgets failure: Success
The program "postgres" is needed by initdb but was not found in the
same directory as "/usr/bin/initdb".
Check your installation.

I did check that file postgres really is in /usr/bin -folder.

How should I proceed now?
--
Jarkko Elfving <jarelf(at)ebaana(dot)net>


From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: Jarkko Elfving <jarelf(at)ebaana(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)
Date: 2005-01-23 06:23:27
Message-ID: 7c1574a9050122222347e1a13c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 23 Jan 2005 08:09:15 +0200, Jarkko Elfving <jarelf(at)ebaana(dot)net> wrote:
> Hi again...
>
> I tried to solve my PostgreSQL cluster problem like Michael Fuhr and
> Lonni Friedman helps me, but I didn't get it work. So I figured out that
> if I do an fresh installation and removed the PostgreSQL completely
> (even those JDBC and PL -drivers - everything) and be sure that it is
> completely removed. Then I installed it again with rpm -Uhv command and
> start to proceed like the manuals tells me, but now I'm in dead-end:
> initdb fails because postgres program was not found. How this could be
> happened? I did not removed the postgres user because I thought that is
> not needed to do. Initdb returns following fail:
>
> # su postgres
> bash-3.00$ initdb -D=/var/lib/pgsql/data/
> fgets failure: Success
> The program "postgres" is needed by initdb but was not found in the
> same directory as "/usr/bin/initdb".
> Check your installation.
>
> I did check that file postgres really is in /usr/bin -folder.
>
> How should I proceed now?

Are you using the RPMs? If so, then starting postgresql with
/etc/init.d/postgresql for the first time will run initdb for you.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama(at)gmail(dot)com
LlamaLand http://netllama.linux-sxs.org


From: Jarkko Elfving <jarelf(at)ebaana(dot)net>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 06:43:32
Message-ID: 1106462613.3195.28.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sat, 2005-01-22 at 22:23 -0800, Lonni J Friedman wrote:
> On Sun, 23 Jan 2005 08:09:15 +0200, Jarkko Elfving <jarelf(at)ebaana(dot)net> wrote:
> > Hi again...
> >
> > I tried to solve my PostgreSQL cluster problem like Michael Fuhr and
> > Lonni Friedman helps me, but I didn't get it work. So I figured out that
> > if I do an fresh installation and removed the PostgreSQL completely
> > (even those JDBC and PL -drivers - everything) and be sure that it is
> > completely removed. Then I installed it again with rpm -Uhv command and
> > start to proceed like the manuals tells me, but now I'm in dead-end:
> > initdb fails because postgres program was not found. How this could be
> > happened? I did not removed the postgres user because I thought that is
> > not needed to do. Initdb returns following fail:
> >
> > # su postgres
> > bash-3.00$ initdb -D=/var/lib/pgsql/data/
> > fgets failure: Success
> > The program "postgres" is needed by initdb but was not found in the
> > same directory as "/usr/bin/initdb".
> > Check your installation.
> >
> > I did check that file postgres really is in /usr/bin -folder.
> >
> > How should I proceed now?
>
> Are you using the RPMs? If so, then starting postgresql with
> /etc/init.d/postgresql for the first time will run initdb for you.
>

Yes. I'm using the RPM's and yes I'd used /etc/init.d/postgresql but it
fails with errors:

# /etc/rc.d/init.d/postgresql start
Initializing database: [FAILED]
Starting postgresql service: [FAILED]

I did the folder /var/lib/pgsql as documets tells me to do and give
rights to postgres as user and a group (hmm... I don't know how say this
properly, so I paste the command what I was used:

mkdir /var/lib/pgsql
chown postgres:postgres /var/lib/pgsql
/etc/rc.d/init.d/postgresql start)

What I'm doing wrong?
--
Jarkko Elfving <jarelf(at)ebaana(dot)net>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jarkko Elfving <jarelf(at)ebaana(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 07:15:02
Message-ID: 2012.1106464502@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jarkko Elfving <jarelf(at)ebaana(dot)net> writes:
> Yes. I'm using the RPM's and yes I'd used /etc/init.d/postgresql but it
> fails with errors:

> # /etc/rc.d/init.d/postgresql start
> Initializing database: [FAILED]
> Starting postgresql service: [FAILED]

> I did the folder /var/lib/pgsql as documets tells me to do and give
> rights to postgres as user and a group (hmm... I don't know how say this
> properly, so I paste the command what I was used:

Uh, /var/lib/pgsql should have been created for you by RPM installation.
I'm starting to think you have a corrupted postgresql-server RPM.

Also, in your prior message:

> bash-3.00$ initdb -D=/var/lib/pgsql/data/
> fgets failure: Success
> The program "postgres" is needed by initdb but was not found in the
> same directory as "/usr/bin/initdb".
> Check your installation.

As best I can tell from the source code, this could only happen if
"/usr/bin/postgres -V" failed. What happens if you do that by hand?
What does "ls -l /usr/bin/postgres" show?

regards, tom lane


From: Jarkko Elfving <jarelf(at)ebaana(dot)net>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 07:46:29
Message-ID: 1106466389.3195.34.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 2005-01-23 at 02:15 -0500, Tom Lane wrote:
> Uh, /var/lib/pgsql should have been created for you by RPM installation.
> I'm starting to think you have a corrupted postgresql-server RPM.
>
> Also, in your prior message:
>
> > bash-3.00$ initdb -D=/var/lib/pgsql/data/
> > fgets failure: Success
> > The program "postgres" is needed by initdb but was not found in the
> > same directory as "/usr/bin/initdb".
> > Check your installation.
>
> As best I can tell from the source code, this could only happen if
> "/usr/bin/postgres -V" failed. What happens if you do that by hand?
> What does "ls -l /usr/bin/postgres" show?
>
> regards, tom lane
>

Yes, I noticed that RPM did a folder /var/lib/pgsql but I was thinking
'coz I didn't get it worked that in easy way, I start to read some of
Postrge instructions where was telling to do this. Anyway, I check what
ls -l /usr/bin/postgres tells me, and result were expected:

# ls -l /usr/bin/postgres
-rwxr-xr-x 1 root root 2541272 Jan 18 11:31 /usr/bin/postgres

Also I run a /usr/bin/postgres -V but this doesn't give any results.

I'm quite new on Linux.

--
Jarkko Elfving <jarelf(at)ebaana(dot)net>


From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: Jarkko Elfving <jarelf(at)ebaana(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 15:46:26
Message-ID: 7c1574a905012307461a2f2212@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 23 Jan 2005 09:46:29 +0200, Jarkko Elfving <jarelf(at)ebaana(dot)net> wrote:
> On Sun, 2005-01-23 at 02:15 -0500, Tom Lane wrote:
> > Uh, /var/lib/pgsql should have been created for you by RPM installation.
> > I'm starting to think you have a corrupted postgresql-server RPM.
> >
> > Also, in your prior message:
> >
> > > bash-3.00$ initdb -D=/var/lib/pgsql/data/
> > > fgets failure: Success
> > > The program "postgres" is needed by initdb but was not found in the
> > > same directory as "/usr/bin/initdb".
> > > Check your installation.
> >
> > As best I can tell from the source code, this could only happen if
> > "/usr/bin/postgres -V" failed. What happens if you do that by hand?
> > What does "ls -l /usr/bin/postgres" show?
> >
> > regards, tom lane
> >
>
> Yes, I noticed that RPM did a folder /var/lib/pgsql but I was thinking
> 'coz I didn't get it worked that in easy way, I start to read some of
> Postrge instructions where was telling to do this. Anyway, I check what
> ls -l /usr/bin/postgres tells me, and result were expected:
>
> # ls -l /usr/bin/postgres
> -rwxr-xr-x 1 root root 2541272 Jan 18 11:31 /usr/bin/postgres
>
> Also I run a /usr/bin/postgres -V but this doesn't give any results.
>
> I'm quite new on Linux.

I'm thinking you're trying to hack too much on your own that the RPMs
do automagically. All you should need to do is install the RPMs,
start postgresql with the provided init script, and be good to go.

I'd suggest uninstalling all postgresql RPMs, deleting /var/lib/pgsql,
reinstalling the RPMs and then just start /etc/init.d/postgresql. If
that fails to work, then set PGLOG in /etc/init.d/postgresql to
something other than /dev/null and try starting again. Then check the
log for why its failing.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama(at)gmail(dot)com
LlamaLand http://netllama.linux-sxs.org


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Lonni J Friedman <netllama(at)gmail(dot)com>
Cc: Jarkko Elfving <jarelf(at)ebaana(dot)net>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 15:57:18
Message-ID: 20050123155718.GA14918@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, Jan 23, 2005 at 07:46:26AM -0800, Lonni J Friedman wrote:
> On Sun, 23 Jan 2005 09:46:29 +0200, Jarkko Elfving <jarelf(at)ebaana(dot)net> wrote:

> I'm thinking you're trying to hack too much on your own that the RPMs
> do automagically. All you should need to do is install the RPMs,
> start postgresql with the provided init script, and be good to go.

I somewhat agree with this. But this is strange and unexpected:

> > Also I run a /usr/bin/postgres -V but this doesn't give any results.

This should return something like

$ postgres -V
postgres (PostgreSQL) 8.1devel

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"¿Que diferencia tiene para los muertos, los huérfanos, y aquellos que han
perdido su hogar, si la loca destrucción ha sido realizada bajo el nombre
del totalitarismo o del santo nombre de la libertad y la democracia?" (Gandhi)


From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: Lonni J Friedman <netllama(at)gmail(dot)com>
Cc: Jarkko Elfving <jarelf(at)ebaana(dot)net>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 16:20:09
Message-ID: Pine.LNX.4.61.0501231808550.27245@emo.org.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Sun, 23 Jan 2005, Lonni J Friedman wrote:

<snip>
> I'd suggest uninstalling all postgresql RPMs, deleting /var/lib/pgsql,
> reinstalling the RPMs and then just start /etc/init.d/postgresql. If
> that fails to work, then set PGLOG in /etc/init.d/postgresql to
> something other than /dev/null and try starting again. Then check the
> log for why its failing.

8.0 RPMs has a better logging feature. There is a pg_log directory under
/var/log/pgsql/data. Also, there is a pgstartup.log file under
/var/log/pgsql. You don't need to alter init script.

Regards,

- --
Devrim GUNDUZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.tdmsoft.com http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFB8869tl86P3SPfQ4RAg4NAJ9vu8ylQE8pYo+Gs2f5O3hoK/SovQCfeCZG
5PbB9DtqouLd/63BPdM/5tc=
=liIZ
-----END PGP SIGNATURE-----


From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Jarkko Elfving <jarelf(at)ebaana(dot)net>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 16:20:18
Message-ID: 7c1574a9050123082039b258a2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 23 Jan 2005 12:57:18 -0300, Alvaro Herrera
<alvherre(at)dcc(dot)uchile(dot)cl> wrote:
> On Sun, Jan 23, 2005 at 07:46:26AM -0800, Lonni J Friedman wrote:
> > On Sun, 23 Jan 2005 09:46:29 +0200, Jarkko Elfving <jarelf(at)ebaana(dot)net> wrote:
>
> > I'm thinking you're trying to hack too much on your own that the RPMs
> > do automagically. All you should need to do is install the RPMs,
> > start postgresql with the provided init script, and be good to go.
>
> I somewhat agree with this. But this is strange and unexpected:
>
> > > Also I run a /usr/bin/postgres -V but this doesn't give any results.
>
> This should return something like
>
> $ postgres -V
> postgres (PostgreSQL) 8.1devel

Where did you get these RPMs?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama(at)gmail(dot)com
LlamaLand http://netllama.linux-sxs.org


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Lonni J Friedman <netllama(at)gmail(dot)com>, Jarkko Elfving <jarelf(at)ebaana(dot)net>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 16:23:24
Message-ID: 4577.1106497404@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> ... But this is strange and unexpected:

>> Also I run a /usr/bin/postgres -V but this doesn't give any results.

Yeah, I thought so too. I was able to reproduce it just now, though,
with selinux enforcement on (sudo /usr/sbin/setenforce 1). Currently
running "yum update" to see if it still happens with the latest
selinux-policy-targeted ... if so there will be a bug report opened
soon, and not against postgres ;-)

The quick answer for Jarkko might be to turn off selinux enforcement.
Especially if he's running an old selinux policy --- there were multiple
PG-related bugs in earlier iterations.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Lonni J Friedman <netllama(at)gmail(dot)com>, Jarkko Elfving <jarelf(at)ebaana(dot)net>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 16:54:34
Message-ID: 4769.1106499274@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> ... running "yum update" to see if it still happens with the latest
> selinux-policy-targeted ... if so there will be a bug report opened
> soon, and not against postgres ;-)

Filed as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=145901

Now initdb had been working for me with the previous selinux policy,
but it seems likely that Jarkko has a several-versions-back policy
that also denies /usr/bin/postgres the ability to write to any pipe :-(

regards, tom lane


From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Lonni J Friedman <netllama(at)gmail(dot)com>
Cc: Jarkko Elfving <jarelf(at)ebaana(dot)net>, Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 17:00:30
Message-ID: 1106499630.4014.135.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Am Sonntag, den 23.01.2005, 07:46 -0800 schrieb Lonni J Friedman:
...
> I'd suggest uninstalling all postgresql RPMs, deleting /var/lib/pgsql,
> reinstalling the RPMs and then just start /etc/init.d/postgresql. If
> that fails to work, then set PGLOG in /etc/init.d/postgresql to
> something other than /dev/null and try starting again. Then check the
> log for why its failing.

I wonder whats the idea of this default log to /dev/null anyway...


From: Jarkko Elfving <jarelf(at)ebaana(dot)net>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 20:09:11
Message-ID: 1106510951.3294.8.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Sun, 2005-01-23 at 08:20 -0800, Lonni J Friedman wrote:
> Where did you get these RPMs?

I'd downloaded it from PostgreSQL's mirror ftp -site (UK).

I'm now starting this re-installing what you guys are suggesting to me.
I will reply in here how I'm succeeded or not succeeded.

One more question: Tom Laine suggest me to switching off the SE-Linux
policy enforcement (I will upgrade my system reqularly, so I think that
I have the latest versions of SE-Linux - I hope) - but, is this SE-Linux
how important service? Friend of my do not use SE-Linux policy at all (I
think).

But now I start my Postgre "recovery project".
--
Jarkko Elfving <jarelf(at)ebaana(dot)net>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jarkko Elfving <jarelf(at)ebaana(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Date: 2005-01-23 20:26:30
Message-ID: 6230.1106511990@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jarkko Elfving <jarelf(at)ebaana(dot)net> writes:
> One more question: Tom Laine suggest me to switching off the SE-Linux
> policy enforcement (I will upgrade my system reqularly, so I think that
> I have the latest versions of SE-Linux - I hope) - but, is this SE-Linux
> how important service? Friend of my do not use SE-Linux policy at all (I
> think).

I think SELinux is important in the long run, but as of Fedora Core 3
it's definitely bleeding-edge stuff with bugs in it. If you just want
to get your work done you might prefer to turn it off. I usually run
with it set to "permissive" mode, which logs violations in syslog but
doesn't actually prevent anything.

regards, tom lane