Thread: problem with setting PATH variable
Hi all, I have installed PostgreSQL 7.4.3 on LINUX 7.2 and some other machines have LINUX 8.0. The problem is that every time my machine restarts the postmaster stops...i have to manually restart the postmaster service....is there any way to automate the postmaster service. I did follow the steps to automate the postmaster service given in the following link http://openacs.org/doc/postgres.html , but that doesnt seem to be working. However it is working on Linux 7.2 sometimes but sometimes its not. But on Linux 8.0 version it is not at all working. Another problem is whenever we login to the postgres session, the path to psql command is not set. So every time we log into postgres session, we have to manually set the path in the PATH environment variable. As soon as we come out of the session, the path is not retained in the PATH variable....any inputs on this is appreciated. Thanks in Advance. > With Best Regards > Pradeep Kumar P J > >
On Thu, Aug 19, 2004 at 21:41:17 -0700, "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com> wrote: > > Hi all, > > I have installed PostgreSQL 7.4.3 on LINUX 7.2 and some other machines have > LINUX 8.0. You specify a distribution name, as there isn't a Linux 7.2 or 8.0, but I believe there may be more than one distribution that used those version numbers. (Though I suspect you are using Redhat.) > The problem is that every time my machine restarts the postmaster stops...i > have to manually restart the postmaster service....is there any way to > automate the postmaster service. I did follow the steps to automate the > postmaster service given in the following link > http://openacs.org/doc/postgres.html , but that doesnt seem to be working. > However it is working on Linux 7.2 sometimes but sometimes its not. But on > Linux 8.0 version it is not at all working. Is a restart attempted, but it fails or is no restart attempted? If it fails, what do the logs say happened? > Another problem is whenever we login to the postgres session, the path to > psql command is not set. So every time we log into postgres session, we have > to manually set the path in the PATH environment variable. As soon as we > come out of the session, the path is not retained in the PATH > variable....any inputs on this is appreciated. Usually you want to set individually customized paths in your initialization file for the shell(s) you use. That might be: .profile, .cshrc, .bashrc, .zshrc,...
I am sorry for the confusion. One machine, I am running Red Hat Linux - 8.0 with kernel version 2.4.18. Other machines have Red Hat Linux - 7.2 with kernel version 2.4.7 Hope this is what you are expecting. I am a newbie to postgresql and Linux, i have no idea about .bashrc,.cshrc,.profile. I dont know where the logfile is, i havent checked it. Only thing is in the link they have given steps to run postmaster automatically on boot. After doing that, it doesnt automatically start after restart....we have to start it manually. There is no problem in starting it manually. In between i noticed some strange thing.... when I run my application....it is creating a number of postmaster services, it was not happening before. when say $ps -el there are more than 10 postmaster services running Then i get the error message - FATAL : sorry too many client connections and other error LOG : unexpected EOF on client connection any inputs on that. -----Original Message----- From: Bruno Wolff III [mailto:bruno@wolff.to] Sent: Friday, August 20, 2004 6:47 PM To: Pradeepkumar, Pyatalo (IE10) Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] problem with setting PATH variable On Thu, Aug 19, 2004 at 21:41:17 -0700, "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com> wrote: > > Hi all, > > I have installed PostgreSQL 7.4.3 on LINUX 7.2 and some other machines have > LINUX 8.0. You specify a distribution name, as there isn't a Linux 7.2 or 8.0, but I believe there may be more than one distribution that used those version numbers. (Though I suspect you are using Redhat.) > The problem is that every time my machine restarts the postmaster stops...i > have to manually restart the postmaster service....is there any way to > automate the postmaster service. I did follow the steps to automate the > postmaster service given in the following link > http://openacs.org/doc/postgres.html , but that doesnt seem to be working. > However it is working on Linux 7.2 sometimes but sometimes its not. But on > Linux 8.0 version it is not at all working. Is a restart attempted, but it fails or is no restart attempted? If it fails, what do the logs say happened? > Another problem is whenever we login to the postgres session, the path to > psql command is not set. So every time we log into postgres session, we have > to manually set the path in the PATH environment variable. As soon as we > come out of the session, the path is not retained in the PATH > variable....any inputs on this is appreciated. Usually you want to set individually customized paths in your initialization file for the shell(s) you use. That might be: .profile, .cshrc, .bashrc, .zshrc,...
On Fri, Aug 20, 2004 at 06:44:27 -0700, "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com> wrote: > > > I am sorry for the confusion. One machine, I am running Red Hat Linux - 8.0 > with kernel version 2.4.18. > Other machines have Red Hat Linux - 7.2 with kernel version 2.4.7 > Hope this is what you are expecting. Yes. > I am a newbie to postgresql and Linux, i have no idea about > .bashrc,.cshrc,.profile. You are going to want to read documentation on whatever shell you are using, so as to learn how to configure things to help you work more efficiently. If you installed postgres by bulding from a source tar ball, most likely stuff you want to use without typing the full path got put in /usr/local/bin. If you install from an rpm, the binaries will normally get put in /usr/bin, which should be in your path. > I dont know where the logfile is, i havent checked it. Only thing is in the > link they have given steps to run postmaster automatically on boot. After > doing that, it doesnt automatically start after restart....we have to start > it manually. There is no problem in starting it manually. This sounds like you may not have told init that postgres is supposed to be started in your default run level. You probably want to read 'man chkconfig' and then use chkconfig to set things so that postgres is started by default. I think you will want to run something like: chkconfig --levels 2345 postgresql on You will need to do that as root. > > In between i noticed some strange thing.... > when I run my application....it is creating a number of postmaster services, > it was not happening before. > when say > $ps -el > there are more than 10 postmaster services running > > Then i get the error message - > FATAL : sorry too many client connections and other error > LOG : unexpected EOF on client connection > > any inputs on that. A separate copy of the postmaster gets started for each database connection. So if your webserver is connecting to your database, having multiple postmaster processes is expected. You probably want to set postgres' limit on the number of connections to be slightly higher than the number of allowed connections to your web server. A limit of only 10 postmaster processes is likely less than what your web server is limited to and may be the source of your problem.
I have installed postgresql by building from a source tar ball. so every time i log in to the postgres session i have to set the PATH variable to /usr/local/bin, is there way so that i dont have to set the PATH variable every time i log into the postgres session. -----Original Message----- From: Bruno Wolff III [mailto:bruno@wolff.to] Sent: Friday, August 20, 2004 7:46 PM To: Pradeepkumar, Pyatalo (IE10) Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] problem with setting PATH variable On Fri, Aug 20, 2004 at 06:44:27 -0700, "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com> wrote: > > > I am sorry for the confusion. One machine, I am running Red Hat Linux - 8.0 > with kernel version 2.4.18. > Other machines have Red Hat Linux - 7.2 with kernel version 2.4.7 > Hope this is what you are expecting. Yes. > I am a newbie to postgresql and Linux, i have no idea about > .bashrc,.cshrc,.profile. You are going to want to read documentation on whatever shell you are using, so as to learn how to configure things to help you work more efficiently. If you installed postgres by bulding from a source tar ball, most likely stuff you want to use without typing the full path got put in /usr/local/bin. If you install from an rpm, the binaries will normally get put in /usr/bin, which should be in your path. > I dont know where the logfile is, i havent checked it. Only thing is in the > link they have given steps to run postmaster automatically on boot. After > doing that, it doesnt automatically start after restart....we have to start > it manually. There is no problem in starting it manually. This sounds like you may not have told init that postgres is supposed to be started in your default run level. You probably want to read 'man chkconfig' and then use chkconfig to set things so that postgres is started by default. I think you will want to run something like: chkconfig --levels 2345 postgresql on You will need to do that as root. > > In between i noticed some strange thing.... > when I run my application....it is creating a number of postmaster services, > it was not happening before. > when say > $ps -el > there are more than 10 postmaster services running > > Then i get the error message - > FATAL : sorry too many client connections and other error > LOG : unexpected EOF on client connection > > any inputs on that. A separate copy of the postmaster gets started for each database connection. So if your webserver is connecting to your database, having multiple postmaster processes is expected. You probably want to set postgres' limit on the number of connections to be slightly higher than the number of allowed connections to your web server. A limit of only 10 postmaster processes is likely less than what your web server is limited to and may be the source of your problem. ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend
On Fri, Aug 20, 2004 at 07:25:22 -0700, "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com> wrote: > > I have installed postgresql by building from a source tar ball. > so every time i log in to the postgres session i have to set the PATH > variable to /usr/local/bin, is there way so that i dont have to set the PATH > variable every time i log into the postgres session. The above doesn't really make sense. You don't log in to a postgres session and then run psql. I think what you really mean is that you are logging into a shell session instead of a postgres session. When you run psql, then you have to authenticate to postgres via some means. (Which may or may not involve supplying a password depending on your setup.) How you set your default search path for your shell depends on your particular shell. You need to read the documentation on your shell to see how to change it. Probably your shell is bash, since that is the default and it seems unlikely that you have changed it. You can use the finger command to see what it is. For bash, your would probably want to add the following to your .bashrc file: PATH=/usr/local/bin:$PATH export PATH