Thread: weird fatal error starting postmaster

weird fatal error starting postmaster

From
"Dana Hudes"
Date:
Upgraded to current postgres via the RPM packages.
postgresql-devel-6.5.3-1
postgresql-jdbc-6.5.3-1
postgresql-odbc-6.5.3-1
postgresql-perl-6.5.3-1
postgresql-python-6.5.3-1
postgresql-server-6.5.3-1
postgresql-6.5.3-1
postgresql-tcl-6.5.3-1
postgresql-test-6.5.3-1

I'm of course on RedHat Linux. Specifically v6.0 .Dual processor PII, running SMP kernel 2.2.5-22smp
I do (in inittab)
/bin/su - postgres -c "/usr/bin/postmaster -D/var/db" >>/var/log/postgres.log 2>&1 </dev/null

and postgres.log says:

IpcMemoryCreate: shmget failed (Identifier removed) key=5432010, size=120, permission=700
IpcMemoryIdGet: shmget failed (Identifier removed) key=5432010, size=120, permission=0
IpcMemoryAttach: shmat failed (Invalid argument) id=-2
FATAL 1:  AttachSLockMemory: could not attach segment

Hmm.  Could this somehow be that user postgres has no permission to create an IPC memory queue?
thought all users could...
thoughts and direction appreciated



Re: [ADMIN] weird fatal error starting postmaster

From
Karl DeBisschop
Date:
> IpcMemoryCreate: shmget failed (Identifier removed) key=5432010, size=120, permission=700
> IpcMemoryIdGet: shmget failed (Identifier removed) key=5432010, size=120, permission=0
> IpcMemoryAttach: shmat failed (Invalid argument) id=-2
> FATAL 1:  AttachSLockMemory: could not attach segment

Could this means that you still have a previous copy of postgres
running that already owns the IPC memory queue?

Karl DeBisschop

Re: [ADMIN] weird fatal error starting postmaster

From
Lamar Owen
Date:
Dana Hudes wrote:
> I'm of course on RedHat Linux. Specifically v6.0 .Dual processor PII, running SMP kernel 2.2.5-22smp
> I do (in inittab)
> /bin/su - postgres -c "/usr/bin/postmaster -D/var/db" >>/var/log/postgres.log 2>&1 </dev/null

Does postmaster start successfully if simply started -- not from
inittab? Also, on RedHat, the standard location of the database is
/var/lib/pgsql, not /var/db -- this could get you into trouble later if
you run into other problems.  This location should only be changed if
there is really GOOD reason to do so.

Run, as root, '/etc/rc.d/init.d/postgresql start' -- it'll initdb in
/var/lib/pgsql if there's no database there.  Then, attempt to connect,
and see what happens. Feel free to modify the
/etc/rc.d/init.d/postgresql script for logging purposes.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: [ADMIN] weird fatal error starting postmaster

From
"Dana Hudes"
Date:
thanks for the idea. It says there is another copy of pg running but I've rebooted the system
and the inittab entry is commented out.

root@harmony log]# /etc/rc.d/init.d/postgresql status
postmaster (pid 565) is running...
[root@harmony log]# ps -l -p 565
 FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
No processes available.
[root@harmony log]#


bizarre. I have this with other processes. For example there are two setiathome processes running
(1 per cpu). I know they're there
[root@harmony log]# uptime
  3:18pm  up 1 day, 20:12,  2 users,  load average: 2.00, 2.00, 2.00
[root@harmony log]#

But I can't see them

[root@harmony log]# ps ax|grep seti
 3025  ?  S    0:00 grep seti

Weird.

----- Original Message -----
From: "Lamar Owen" <lamar.owen@wgcr.org>
To: "Dana Hudes" <dhudes@hudes.org>
Cc: <pgsql-admin@postgreSQL.org>
Sent: Wednesday, January 05, 2000 1:49 PM
Subject: Re: [ADMIN] weird fatal error starting postmaster


> Dana Hudes wrote:
> > I'm of course on RedHat Linux. Specifically v6.0 .Dual processor PII, running SMP kernel 2.2.5-22smp
> > I do (in inittab)
> > /bin/su - postgres -c "/usr/bin/postmaster -D/var/db" >>/var/log/postgres.log 2>&1 </dev/null
>
> Does postmaster start successfully if simply started -- not from
> inittab? Also, on RedHat, the standard location of the database is
> /var/lib/pgsql, not /var/db -- this could get you into trouble later if
> you run into other problems.  This location should only be changed if
> there is really GOOD reason to do so.
>
> Run, as root, '/etc/rc.d/init.d/postgresql start' -- it'll initdb in
> /var/lib/pgsql if there's no database there.  Then, attempt to connect,
> and see what happens. Feel free to modify the
> /etc/rc.d/init.d/postgresql script for logging purposes.
>
> --
> Lamar Owen
> WGCR Internet Radio
> 1 Peter 4:11


Re: [ADMIN] weird fatal error starting postmaster

From
Karl DeBisschop
Date:
looks like the postmaster is being started by tyhe init script -
standard behavior for the RPMs, I think.  Can you be superuser?

If so, do `/etc/rc.d/init.d/postgresql stop`

I have no idea why your ps doesn't show up.  maybe try `ps -u
postgres`

Karl

Re: [ADMIN] weird fatal error starting postmaster

From
"Dana Hudes"
Date:
Submitted for someone to tell me what the heck is going on....

[root@harmony log]# /etc/rc.d/init.d/postgresql stop
Stopping postgresql service:                               [  OK  ]
[root@harmony log]# /etc/rc.d/init.d/postgresql start
Checking postgresql installation: looks good!
Postmaster already running.
[root@harmony log]#

----- Original Message -----
From: "Lamar Owen" <lamar.owen@wgcr.org>
To: "Dana Hudes" <dhudes@hudes.org>
Cc: <pgsql-admin@postgreSQL.org>
Sent: Wednesday, January 05, 2000 1:49 PM
Subject: Re: [ADMIN] weird fatal error starting postmaster


> Dana Hudes wrote:
> > I'm of course on RedHat Linux. Specifically v6.0 .Dual processor PII, running SMP kernel 2.2.5-22smp
> > I do (in inittab)
> > /bin/su - postgres -c "/usr/bin/postmaster -D/var/db" >>/var/log/postgres.log 2>&1 </dev/null
>
> Does postmaster start successfully if simply started -- not from
> inittab? Also, on RedHat, the standard location of the database is
> /var/lib/pgsql, not /var/db -- this could get you into trouble later if
> you run into other problems.  This location should only be changed if
> there is really GOOD reason to do so.
>
> Run, as root, '/etc/rc.d/init.d/postgresql start' -- it'll initdb in
> /var/lib/pgsql if there's no database there.  Then, attempt to connect,
> and see what happens. Feel free to modify the
> /etc/rc.d/init.d/postgresql script for logging purposes.
>
> --
> Lamar Owen
> WGCR Internet Radio
> 1 Peter 4:11


Re: [ADMIN] weird fatal error starting postmaster

From
Karl DeBisschop
Date:
seems like your ps is not standards redhat.  "ps -u postgres" works
fine for me on RH60 and RH61.  This could easily affect the way your
init script works - the functions us ps in part to get pid values.

I'd run the stop repeatedly until you always get a 'failed' trying to
stop the db.  Then run the start.

I've got a suspician that inittab may not ne synced and init is still
restarting the postmaster on you.  I'm not sure, but it may be worth
double or triple checking.

Good luck

Karl

Re: [ADMIN] weird fatal error starting postmaster

From
Lamar Owen
Date:
Dana Hudes wrote:
>
> Submitted for someone to tell me what the heck is going on....
>
> [root@harmony log]# /etc/rc.d/init.d/postgresql stop
> Stopping postgresql service:                               [  OK  ]
> [root@harmony log]# /etc/rc.d/init.d/postgresql start
> Checking postgresql installation: looks good!
> Postmaster already running.

The error message 'Postmaster already running.' comes after a check for
a running postmaster using the RedHat initscript function 'pidof' --
which determines the pid of any running postmaster.  What processes does
a plain 'ps ax' show?

From your previous messages, it is plain that there is some other system
issue occuring that you need to troubleshoot before you'll be able to
get PostgreSQL running -- a ps ax|grep of known running processes should
work, otherwise you have something else going on.

By using 'ls -l /proc |grep postgres' -- you should be able to find any
running processes belonging to postgres.  Also, you can find out what
the initscript thinks by spawning a subshell, cd to /etc/rc.d/init.d,
and executing:
. functions
pidof postmaster
which will give you the pid of postmaster.  You can then kill it from
root.
You can get any process's status by using 'cat /proc/$pid/status', where
$pid is the pid you are wanting to query.  This is just in case someone
has rootkitted your ps.

I'm also assuming that you've told init to reload inittab (telinit Q) --
otherwise init is respawning postmaster faster than it can be killed.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11