Thread: Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)
Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)
From
Jarkko Elfving
Date:
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@ebaana.net>
Re: Dead-end in PostgreSQL 8.0 fresh installation (while upgrading doesn't get anywhere)
From
Lonni J Friedman
Date:
On Sun, 23 Jan 2005 08:09:15 +0200, Jarkko Elfving <jarelf@ebaana.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@gmail.com LlamaLand http://netllama.linux-sxs.org
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@ebaana.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@ebaana.net>
Jarkko Elfving <jarelf@ebaana.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
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@ebaana.net>
On Sun, 23 Jan 2005 09:46:29 +0200, Jarkko Elfving <jarelf@ebaana.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@gmail.com LlamaLand http://netllama.linux-sxs.org
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@ebaana.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[@]dcc.uchile.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)
On Sun, 23 Jan 2005 12:57:18 -0300, Alvaro Herrera <alvherre@dcc.uchile.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@ebaana.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@gmail.com LlamaLand http://netllama.linux-sxs.org
-----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-----
Alvaro Herrera <alvherre@dcc.uchile.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
Tom Lane <tgl@sss.pgh.pa.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
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...
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@ebaana.net>
Jarkko Elfving <jarelf@ebaana.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