Thread: pg_ctrl stop problems (psql 8.2.5)

pg_ctrl stop problems (psql 8.2.5)

From
"LARC/J.L.Shipman/jshipman"
Date:
Hello,
I am running postgresql 8.2.5 on Solaris 10.  When I try to shut down postgres using

pg_ctrl -D datafile stop

it does not shutdown.    Does anyone know why this is, or what files pg_ctrl access to determine
the shutdown process.  We have tried deleting a pgsql semaphore file located in tmp.  This did not help.  Any help is appreciated.






757-864-7114
LARC/J.L.Shipman/jshipman




Re: pg_ctrl stop problems (psql 8.2.5)

From
Erik Jones
Date:
On Mar 25, 2008, at 11:49 AM, LARC/J.L.Shipman/jshipman wrote:
> Hello,
>     I am running postgresql 8.2.5 on Solaris 10.  When I try to shut
> down postgres using
>
> pg_ctrl -D datafile stop
>
> it does not shutdown.    Does anyone know why this is, or what files
> pg_ctrl access to determine
> the shutdown process.  We have tried deleting a pgsql semaphore file
> located in tmp.  This did not help.  Any help is appreciated.

Without more information it's hard to do more than guess.  First, I'll
assume that datafile is actually your data directory.  Past that, I'd
guess that you still have open connections on your database.  pg_ctl
accepts a -m flag for the shutdown mode which can be one of 'smart',
'fast', or 'immediate' with smart being the default which will wait
for all existing connections to close before actually shutting down
the server.  If you want to cut those connections off, use fast mode,
which will roll back any open transactions and close any existing
connections then shut down.  Don't use immediate unless  you really
know what you're doing as it's the equivalent of sending kill -9 to
the postmaster.

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com




Re: pg_ctrl stop problems (psql 8.2.5)

From
Zdenek Kotala
Date:
LARC/J.L.Shipman/jshipman napsal(a):
> Hello,
>     I am running postgresql 8.2.5 on Solaris 10.  When I try to shut
> down postgres using
>
> pg_ctrl -D datafile stop
>
> it does not shutdown.    Does anyone know why this is, or what files
> pg_ctrl access to determine
> the shutdown process.  We have tried deleting a pgsql semaphore file
> located in tmp.  This did not help.  Any help is appreciated.

Solaris uses SMF for starting and stopping postgreSQL. If postgres was started
by SMF then it tries to restart when it fails (or stopeed another way).

try

svcs postgresql

it shows you status.

svcs disable postgresql:version_82

stop postgresql.

See man postgres_82 for detail.

        Zdenek

Re: pg_ctrl stop problems (psql 8.2.5)

From
"F. Jovan Jester"
Date:
As Zdenek mentioned, in Solaris 10 postgresql is run as a service, so
any attempts at stopping it manually will be detected and it will
automatically be started again.

The syntax was a bit off though (because the service may not
necessarily be called postgresql:version_82, and you need svcadm
instead of svcs for starting or stopping). Try the following:

svcs -a | grep postgres
(this command should show it is online, note the name, probably
something like svc:/application/database/postgresql:postgres)

then, as root do the following:

svcadm disable postgresql
(then do an svcs -a | grep postgres again to verify it's disabled)

That will stop it. To restart:

svcadm enable postgresql

also as root. any svcadm commands require root.

hope that helps

-Jovan

On Tue, Mar 25, 2008 at 11:11 AM, Zdenek Kotala <Zdenek.Kotala@sun.com> wrote:
> LARC/J.L.Shipman/jshipman napsal(a):
>
> > Hello,
> >     I am running postgresql 8.2.5 on Solaris 10.  When I try to shut
> > down postgres using
> >
> > pg_ctrl -D datafile stop
> >
> > it does not shutdown.    Does anyone know why this is, or what files
> > pg_ctrl access to determine
> > the shutdown process.  We have tried deleting a pgsql semaphore file
> > located in tmp.  This did not help.  Any help is appreciated.
>
> Solaris uses SMF for starting and stopping postgreSQL. If postgres was started
> by SMF then it tries to restart when it fails (or stopeed another way).
>
> try
>
> svcs postgresql
>
> it shows you status.
>
> svcs disable postgresql:version_82
>
> stop postgresql.
>
> See man postgres_82 for detail.
>
>                Zdenek
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Re: pg_ctrl stop problems (psql 8.2.5)

From
Zdeněk Kotala
Date:
F. Jovan Jester napsal(a):

>
> svcs -a | grep postgres
> (this command should show it is online, note the name, probably
> something like svc:/application/database/postgresql:postgres)
>
> then, as root do the following:
>
> svcadm disable postgresql
> (then do an svcs -a | grep postgres again to verify it's disabled)
>
> That will stop it. To restart:
>
> svcadm enable postgresql
>
> also as root. any svcadm commands require root.

Just for completion. All user which has "Postgres Administration" profile
assigned are allow to start/restart/stop/ server.

See http://www.sun.com/bigadmin/features/articles/postgresql_opensolaris.jsp for
detail.


        Zdenek