Lists: | pdxpug |
---|
From: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
---|---|
To: | pdxpug(at)postgresql(dot)org |
Subject: | Problems With New Installation |
Date: | 2009-01-25 01:02:41 |
Message-ID: | alpine.LNX.2.00.0901241656460.32745@salmo.appl-ecosys.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
I installed 8.3.5 on my notebook so that I can run a business application.
I used the Slackware package approach and everything seems to be in place,
but there is no /tmp/.s.PGSQL.5432 or associated lock file.
Starting the server produces a message that the PostgreSQL daemon is
already running. Stopping the server produces the message that there's no
directory so it's logging in with HOME=/, and there's an invalid
postmaster.pid.
Restarting postgres does not create the /tmp socket and lock. The user
'postgres' exists and has the home directory of /home/postgres. My Google
searches and reading through the Douglas^2 book gives me no clues.
What do I do to properly start/stop the postmaster?
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: | Ronald Chmara <ronabop(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 02:46:27 |
Message-ID: | 2BF24784-D7EC-4213-AE0B-CE00216E9F4C@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
On Jan 24, 2009, at 5:02 PM, Rich Shepard wrote:
> I installed 8.3.5 on my notebook so that I can run a business
> application.
> I used the Slackware package approach and everything seems to be in
> place,
> but there is no /tmp/.s.PGSQL.5432 or associated lock file.
>
> Starting the server produces a message that the PostgreSQL daemon is
> already running. Stopping the server produces the message that
> there's no
> directory so it's logging in with HOME=/, and there's an invalid
> postmaster.pid.
>
> Restarting postgres does not create the /tmp socket and lock. The
> user
> 'postgres' exists and has the home directory of /home/postgres. My
> Google
> searches and reading through the Douglas^2 book gives me no clues.
IIRC, the postgres init scripts used to not only set up sockets, but
also had some checks on prior PID and lock files, in case there was a
crashed startup that needed recovery...
Have you tried looking through your init/startup scripts at the
specific checks, and/or removed old/invalid pid and lock files?
-Bop
From: | znmeb(at)cesmail(dot)net |
---|---|
To: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 05:34:26 |
Message-ID: | 20090125003426.xynriq5w8cso048k-mazro@webmail.spamcop.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
Quoting Rich Shepard <rshepard(at)appl-ecosys(dot)com>:
> I installed 8.3.5 on my notebook so that I can run a business application.
> I used the Slackware package approach and everything seems to be in place,
> but there is no /tmp/.s.PGSQL.5432 or associated lock file.
>
> Starting the server produces a message that the PostgreSQL daemon is
> already running. Stopping the server produces the message that there's no
> directory so it's logging in with HOME=/, and there's an invalid
> postmaster.pid.
>
> Restarting postgres does not create the /tmp socket and lock. The user
> 'postgres' exists and has the home directory of /home/postgres. My Google
> searches and reading through the Douglas^2 book gives me no clues.
>
> What do I do to properly start/stop the postmaster?
>
> Rich
>
> --
> Richard B. Shepard, Ph.D. | Integrity Credibility
> Applied Ecosystem Services, Inc. | Innovation
> <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
>
> --
> Sent via pdxpug mailing list (pdxpug(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pdxpug
Here's a couple of things to look for:
1. Do you have to do an "initdb"? Some distros do that automatically,
and some don't. When I was running Gentoo, I had to do an extra
"configure" step after the install to get that to happen. The
"configure" is automatic on openSUSE 11.1 when you install, and I
think that's true for Debian-based distros as well. Try "man initdb".
On openSUSE, the PostgreSQL files default to "/var/lib/pgsql" and
belong to "postgres:postgres". In there, you'll see a "backups"
directory and a "data" directory, and the configuration files are in
the "data" directory. On my system, there's an "initlog" which has all
the logs from when "initdb" was run.
2. If "initdb" has been done, is there an "/etc/init.d/postgresql"
file? What happens if you do "/etc/init.d/postgresql restart"? That's
how I restart PostgreSQL. Also, there's undoubtedly a way you can get
it to start automatically at boot time when you enter your default run
level. I used the GUI runlevel editing tool. :)
3. If that doesn't work, try a "man pg_ctl". That's the command that
is designed to start and stop and reload. It has some environment
variables that need to be set so it knows where "initdb" put the
database.
One thing that might help (from the Douglas^2 book) would be to do
"sudo su - postgres" and see which command-line utilities actually
function. There are also some settings in "postgresql.conf" and
"pg_hba.conf" you might need to set so that when the postmaster is
running, you have permissions to execute stuff.
From: | "M(dot) Edward (Ed) Borasky" <znmeb(at)cesmail(dot)net> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 06:33:44 |
Message-ID: | 497C07C8.2010106@cesmail.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
Rich Shepard wrote:
> I installed 8.3.5 on my notebook so that I can run a business
> application.
> I used the Slackware package approach and everything seems to be in place,
> but there is no /tmp/.s.PGSQL.5432 or associated lock file.
>
> Starting the server produces a message that the PostgreSQL daemon is
> already running. Stopping the server produces the message that there's no
> directory so it's logging in with HOME=/, and there's an invalid
> postmaster.pid.
>
> Restarting postgres does not create the /tmp socket and lock. The user
> 'postgres' exists and has the home directory of /home/postgres. My Google
> searches and reading through the Douglas^2 book gives me no clues.
>
> What do I do to properly start/stop the postmaster?
>
> Rich
>
1. Do you have to do an "initdb"? Some distros do that automatically,
and some don't. When I was running Gentoo, I had to do an extra
"configure" step after the install to get that to happen. The
"configure" is automatic on openSUSE 11.1 when you install, and I
think that's true for Debian-based distros as well. Try "man initdb".
On openSUSE, the PostgreSQL files default to "/var/lib/pgsql" and belong
to "postgres:postgres". In there, I see a "backups" directory and a
"data" directory, and the configuration files are in the "data"
directory. On my system, there's an "initlog" which has all the messages
from when "initdb" was run.
2. If "initdb" has been done, is there an "/etc/init.d/postgresql" file?
What happens if you do "/etc/init.d/postgresql restart"? That's how I
restart PostgreSQL. Also, there's undoubtedly a way you can get it to
start automatically at boot time when you enter your default run level.
I used the GUI runlevel editing tool. :)
3. If that doesn't work, try a "man pg_ctl". That's the command that is
designed to start and stop and reload. It has some environment variables
that need to be set so it knows where "initdb" put the database.
One other thing that might help (from the Douglas^2 book) would be to do
"sudo su - postgres" and see which command-line utilities actually
function. There's "pg_ctl" and the "psql" client, and some dump and
restore utilities. And there may be some settings in "postgresql.conf"
and "pg_hba.conf" you might need to set so that when the postmaster is
running, you have permissions to execute stuff.
--
M. Edward (Ed) Borasky
I've never met a happy clam. In fact, most of them were pretty steamed.
From: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
---|---|
To: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 14:36:36 |
Message-ID: | alpine.LNX.2.00.0901250630110.29851@salmo.appl-ecosys.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
On Sat, 24 Jan 2009, M. Edward (Ed) Borasky wrote:
> 1. Do you have to do an "initdb"?
Ed,
Yes, I ran 'initdb -D /var/lib/pgsql/data'
> On openSUSE, the PostgreSQL files default to "/var/lib/pgsql" and belong
> to "postgres:postgres". In there, I see a "backups" directory and a
> "data" directory, and the configuration files are in the "data"
> directory. On my system, there's an "initlog" which has all the messages
> from when "initdb" was run.
It is all set up as it should be. However, it will not properly start
(creating the socket and .pid as well as telling me the daemon is already
running), while it does shut down something.
> 2. If "initdb" has been done, is there an "/etc/init.d/postgresql" file?
> What happens if you do "/etc/init.d/postgresql restart"?
Yes, there is a script. In Slackware they're all in /etc/rc.d, and the
rc.postgresql script is installed automatically. It is executable and run
frrom within /etc/rc.d/rc.local durint the boot process.
All this works well -- and has for 10 or so years -- on my desktop
systems. That's why I'm asking for help in figuring out why it isn't
behaving the same way on the notebook.
> 3. If that doesn't work, try a "man pg_ctl".
pg_ctl is what the rc.postgresql script calls to start, stop, and restart
the process.
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
---|---|
To: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 21:21:45 |
Message-ID: | alpine.LNX.2.00.0901251247490.29851@salmo.appl-ecosys.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
On Sun, 25 Jan 2009, M. Edward (Ed) Borasky wrote:
> I should probably build a Slackware virtual machine so I can see where the
> PostgreSQL log files end up. :) If there aren't log files, you can
> probably edit the scripts and capture them.
Let me reiterate. Postgres-8.3.3 (and all the earlier versions since 6.x)
have installed and run just fine on my servers. This issue now is with
-8.3.5 on my notebook.
There's nothing in /var/log/postgresql.
When I try to start the server (using '/etc/rc.d/rc.postgresql start')
this is displayed:
Starting PostgreSQL
2764
PostgreSQL daemon already running
This from a fresh boot of the notebook and postgres not starting
automatically. There's still nothing in /var/log/postgresql.
Now, when I stop the server ('/etc/rc.d/rc.postgreql stop') this is
displayed on the console:
Shutting down PostgreSQL...
No directory, logging in with HOME=/
pg_ctl: invalid data in PID file "/var/lib/pgsql/data/postmaster.pid"
The PID file is empty; I created it by touching it. So, if I remove that
.pid file and try starting the server, rather than creating that file I see
the same three lines as above with a new fourth line that reads,
Warning: Missing pid file /var/lib/pgsql/data/postmaster.pid
Checkmate. And, after stopping the server I run '/etc/rc.d/rc.postgresql
status' I see:
2801
PostgreSQL is running
Warning: Missing pid file /var/lib/pgsql/data/postmaster.pid
More importantly, a look at running processes ('ps ax') reveals there is no
process ID 2801. The list jumps from 2789 to 2805.
Here's the top of /etc/rc.d/rc.postgresql with comments removed:
LOGFILE=/var/log/postgresql
DATADIR=/var/lib/pgsql/data
POSTGRES=/usr/bin/postgres
PIDFILE=postmaster.pid
# Return values (according to LSB):
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
pg_ctl()
{
CMD="/usr/bin/pg_ctl $@"
su - postgres -c "$CMD"
}
if [ ! -f $POSTGRES ]; then
echo "Could not find 'postgres' binary. Maybe PostgreSQL is not installed properly?"
exit 5
fi
case "$1" in
"start")
echo "Starting PostgreSQL"
touch $LOGFILE
chown postgres:wheel $LOGFILE
chmod 0640 $LOGFILE
if [ ! -e $DATADIR/PG_VERSION ]; then
echo "You should initialize the PostgreSQL database at location $DATADIR"
exit 6
fi
if pgrep postgres; then
echo "PostgreSQL daemon already running"
if [ ! -f $DATADIR/$PIDFILE ]; then
echo "Warning: Missing pid file $DATADIR/$PIDFILE"
fi
exit 1
else # remove old socket, if it exists and no daemon is running.
if [ ! -f $DATADIR/$PIDFILE ]; then
rm -f /tmp/.s.PGSQL.5432
rm -f /tmp/.s.PGSQL.5432.lock
# pg_ctl start -w -l $LOGFILE -D $DATADIR
su postgres -c 'postgres -D /var/lib/pgsql/data &'
exit 0
else
echo "PostgreSQL daemon was not properly shut down"
echo "Please remove stale pid file $DATADIR/$PIDFILE"
exit 7
fi
fi
;;
HTH,
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: | Jon Scully <jonscully(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation |
Date: | 2009-01-25 22:46:48 |
Message-ID: | 53107f6e0901251446r75e119fm6a45d6e4d096622b@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
Did you upgrade from, say, 8.3.3 to 8.3.5?
Newer rc script can be found here (look for "rc.postgresql.new"):
http://slackbuilds.org/repository/12.1/system/postgresql/
At the least, change from / to:
su postgres -c 'postgres -D /var/lib/pgsql/data &'
su - postgres -c 'postgres -D /var/lib/pgsql/data &'
Also check:
$ sudo cat /etc/passwd | grep postgres
postgres:x:88:88::/var/lib/pgsql:/bin/bash
From: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
---|---|
To: | pdxpug(at)postgresql(dot)org |
Subject: | Re: Problems With New Installation -- FIXED |
Date: | 2009-01-26 00:12:57 |
Message-ID: | alpine.LNX.2.00.0901251535050.3662@salmo.appl-ecosys.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pdxpug |
On Sun, 25 Jan 2009, Jon Scully wrote:
> Did you upgrade from, say, 8.3.3 to 8.3.5?
Jon,
Not on the laptop. I had not been running postgres on it before.
> Newer rc script can be found here (look for "rc.postgresql.new"):
> http://slackbuilds.org/repository/12.1/system/postgresql/
That's what the build/installation script installed as rc.postgresql.
> At the least, change from / to:
> su postgres -c 'postgres -D /var/lib/pgsql/data &'
This is what the script is supposed to do. But, ... ta da! ... running it
manually from the command line (su'ing first to postgres, then starting the
postmaster) did work after I removed the stale socket.
Thank you,
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863