pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Kill Process ERROR !!!
7+ messages / 6 participants
[nested] [flat]
* Re: Kill Process ERROR !!!
@ 2003-07-09 04:34 Andrew Sullivan <andrew@libertyrms.info>
parent: aris wendy <aris_postgre@telkom.net>
2 siblings, 1 reply; 7+ messages in thread
From: Andrew Sullivan @ 2003-07-09 04:34 UTC (permalink / raw)
To: pgsql-admin
On Wed, Jul 09, 2003 at 09:52:38AM +0000, aris wendy wrote:
>
> I want to kill process no 582, I use kill -9 582 but all user become
> disconnect look at below
Try kill -2.
A
--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew@libertyrms.info> M2P 2A8
+1 416 646 3304 x110
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Kill Process ERROR !!!
@ 2003-07-09 07:54 andrea suisani <suisani@demetra.com>
parent: aris wendy <aris_postgre@telkom.net>
2 siblings, 0 replies; 7+ messages in thread
From: andrea suisani @ 2003-07-09 07:54 UTC (permalink / raw)
To: aris wendy <aris_postgre@telkom.net>; +Cc: pgsql-admin
Aris,
aris wendy wrote:
> Dear master
>
[snip]
>
> I want to kill process no 582, I use kill -9 582 but all user become
> disconnect look at below
[snip]
>
> how to kill only one process ?
>
> TIA
try with kill -15 582
it works with postgresql ver 7.2.4
Andrea
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Kill Process ERROR !!!
@ 2003-07-09 08:56 Andrea Suisani <andrea.suisani@opinioni.net>
parent: aris wendy <aris_postgre@telkom.net>
2 siblings, 0 replies; 7+ messages in thread
From: Andrea Suisani @ 2003-07-09 08:56 UTC (permalink / raw)
To: aris wendy <aris_postgre@telkom.net>; +Cc: pgsql-admin
Aris,
aris wendy wrote:
> Dear master
[snip]
>
> I want to kill process no 582, I use kill -9 582 but all user become disconnect look
at below
[snip]
>
> how to kill only one process ?
>
> TIA
try with kill -15 <pid>
it works with postgresql ver 7.2.4
Andrea
^ permalink raw reply [nested|flat] 7+ messages in thread
* Kill Process ERROR !!!
@ 2003-07-09 09:52 aris wendy <aris_postgre@telkom.net>
0 siblings, 3 replies; 7+ messages in thread
From: aris wendy @ 2003-07-09 09:52 UTC (permalink / raw)
To: pgsql-admin
Dear master
How to kill a process in postgresql. I use ps auxw | grep postgres to see
status....
it-linux:/usr/local/pgsql/data# ps auxw | grep postgres
postgres 197 0.0 7.1 318528 64244 ? S 08:07 0:00
/usr/local/pgsql/bin/postmaster
postgres 206 0.0 0.1 319484 1244 ? S 08:07 0:00 postgres:
stats buffer process
postgres 207 0.0 6.1 318516 55580 ? S 08:07 0:00 postgres:
stats collector process
yudha 571 0.0 0.1 2448 1068 pts/0 S 09:56 0:00 psql
-Upostgres csa
postgres 572 0.0 8.8 319940 79208 ? S 09:56 0:00 postgres:
postgres csa [local] idle
postgres 582 0.5 9.6 320284 86968 ? S 10:02 0:00 postgres: it
csa 192.168.0.234 idle
postgres 587 1.1 10.4 320972 93636 ? S 10:04 0:00 postgres:
postgres csa 192.168.0.111 idle
postgres 588 14.6 10.0 320536 90448 ? S 10:04 0:01 postgres:
postgres csa 192.168.0.100 idle
postgres 589 2.0 7.3 318844 66232 ? S 10:05 0:00 postgres:
checkpoint subprocess
postgres 590 0.0 7.9 320020 71592 ? R 10:05 0:00 postgres:
postgres csa 192.168.0.222 SELECT
root 592 0.0 0.0 1332 424 pts/1 S 10:05 0:00 grep postgres
I want to kill process no 582, I use kill -9 582 but all user become
disconnect look at below
it-linux:/usr/local/pgsql/data# ps auxw | grep postgres
postgres 197 0.0 7.1 318564 64264 ? S 08:07 0:00
/usr/local/pgsql/bin/postmaster
postgres 206 0.0 0.1 319484 1244 ? S 08:07 0:00 postgres:
stats buffer process
postgres 207 0.0 6.1 318516 55580 ? S 08:07 0:00 postgres:
stats collector process
yudha 571 0.0 0.1 2448 1068 pts/0 S 09:56 0:00 psql
-Upostgres csa
root 599 0.0 0.0 1332 424 pts/1 S 10:06 0:00 grep postgres
how to kill only one process ?
TIA
Best Regards
Aris Wendy
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Kill Process ERROR !!!
@ 2003-07-09 12:33 Terry Hampton <thampton@limacorp.com>
parent: Andrew Sullivan <andrew@libertyrms.info>
0 siblings, 1 reply; 7+ messages in thread
From: Terry Hampton @ 2003-07-09 12:33 UTC (permalink / raw)
To: Andrew Sullivan <andrew@libertyrms.info>; +Cc: pgsql-admin@postgresql.org, Terry Hampton <thampton@LimaCorp.com>
Andrew Sullivan wrote:
> On Wed, Jul 09, 2003 at 09:52:38AM +0000, aris wendy wrote:
>
>>I want to kill process no 582, I use kill -9 582 but all user become
>>disconnect look at below
>
>
> Try kill -2.
>
> A
>
The " kill -2 " is much better advice.
Might I suggest to all - AVOID the " classic " kill -9 !
Never use it, unless nothing else works. It's curious why
" kill -9 " is such a part of " common " UNIX practice.
Yes it works, but it's messy and often leads to problems as
Andrew experienced. The "9" signal is too brute force,
and should only be used as a LAST resort.
Your first command to kill a process is simple: kill <pid>
Notice - NO signal value. By default UNIX sends a signal 15
with the kill command. Signal 15 is the default because
it is the normal termination signal. ( I don't have a manual in
handy to give you the exact name of the signal ). Signal 15
should ALWAYS be used first since it tells the process to
terminate as if the process was terminating on its own. This
means, the process will more likely clean up after itself,
regarding file descriptors, child processes, etc.
Speaking of child processes, ALWAYS kill any child processe
first - and more specifically from high to low PID value. Basically,
the higher the PID value, the newer or younger the child. Why
kill child processes first ? - UNIX processes are very signal
driven. The parent of any processes looks for signals from its
children, and acts accordingly. Processes always have a parent.
Child processes that are orphaned, are sometimes " adopted " by
another process - and that is always process 1 Usually,
this is the story behind " zombies " - those processes you can't
kill or will go away. Next time you see a <zombie>, notice its
parent PID is 1.
If simple kill <pid> doesn't work try: kill -HUP <pid>
All signal values also have a 3 char abreviation of it's role.
" HUP " is short for " hang up ", which is signal 1
( not to be confused with process 1 )
I have found that simple kill <pid> works 95% of the time.
kill -HUP <pid> most always gets those processes that are more
persistent, for some reason. I truly don't remember that last time
I used kill -9
Lastly - please learn all the signal values and what they do.
As I remember, there are 19 signals - each with a unique
degree of " strength " and purpose. No - the higher value
is not a more powerfull kill. To more smoothly manage
a UNIX system, use the appropriate kill signal value. You'll
avoid problems like those Andrew found.
Again - don't use kill -9
thanks,
Terry Hampton
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Kill Process ERROR !!!
@ 2003-07-09 15:39 scott.marlowe <scott.marlowe@ihs.com>
parent: Terry Hampton <thampton@limacorp.com>
0 siblings, 1 reply; 7+ messages in thread
From: scott.marlowe @ 2003-07-09 15:39 UTC (permalink / raw)
To: Terry Hampton <thampton@limacorp.com>; +Cc: Andrew Sullivan <andrew@libertyrms.info>; pgsql-admin
On Wed, 9 Jul 2003, Terry Hampton wrote:
> Andrew Sullivan wrote:
> > On Wed, Jul 09, 2003 at 09:52:38AM +0000, aris wendy wrote:
> >
> >>I want to kill process no 582, I use kill -9 582 but all user become
> >>disconnect look at below
> >
> >
> > Try kill -2.
> >
>
> The " kill -2 " is much better advice.
>
> Might I suggest to all - AVOID the " classic " kill -9 !
> Never use it, unless nothing else works. It's curious why
> " kill -9 " is such a part of " common " UNIX practice.
>
> Yes it works, but it's messy and often leads to problems as
> Andrew experienced. The "9" signal is too brute force,
> and should only be used as a LAST resort.
>
> Your first command to kill a process is simple: kill <pid>
>
> Notice - NO signal value. By default UNIX sends a signal 15
> with the kill command. Signal 15 is the default because
> it is the normal termination signal. ( I don't have a manual in
> handy to give you the exact name of the signal ). Signal 15
> should ALWAYS be used first since it tells the process to
> terminate as if the process was terminating on its own. This
> means, the process will more likely clean up after itself,
> regarding file descriptors, child processes, etc.
What amazes me is how many people don't try 'kill pid' first.
> Speaking of child processes, ALWAYS kill any child processe
> first - and more specifically from high to low PID value. Basically,
> the higher the PID value, the newer or younger the child. Why
> kill child processes first ? - UNIX processes are very signal
> driven. The parent of any processes looks for signals from its
> children, and acts accordingly. Processes always have a parent.
> Child processes that are orphaned, are sometimes " adopted " by
> another process - and that is always process 1 Usually,
> this is the story behind " zombies " - those processes you can't
> kill or will go away. Next time you see a <zombie>, notice its
> parent PID is 1.
Please note that this is not necessarily true. If my server has been up a
while and I stop/restart the postmaster, it may have a fairly high id
number and it is quite possible that in x number of days time, the
children will be created with a wrapped pid which is lower than the
postmasters. Just look for the - switches that make it obvious. In fact,
this IS currently the case right now on my server:
13081 ? S 2:30 /usr/local/pgsql/bin/postmaster
13082 ? S 0:19 postgres: stats buffer process
13083 ? S 0:28 postgres: stats collector process
5600 ? S 0:00 postgres: marlowe phone [local] idle
In this case 13081 is my postmaster.
Notice that kill -9 to any postgresql backend results in all backend
connections flushing their buffers. kill -9 to the postmaster results in
a dirty shutdown and the database server has to go through the WAL and
clean things up. It's not the same as hitting the Big Red Switch, but
it's close.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Kill Process ERROR !!!
@ 2003-07-09 16:10 Terry Hampton <thampton@limacorp.com>
parent: scott.marlowe <scott.marlowe@ihs.com>
0 siblings, 0 replies; 7+ messages in thread
From: Terry Hampton @ 2003-07-09 16:10 UTC (permalink / raw)
To: scott.marlowe <scott.marlowe@ihs.com>; +Cc: Andrew Sullivan <andrew@libertyrms.info>; pgsql-admin
scott.marlowe wrote:
>
> Please note that this is not necessarily true. If my server has been up a
> while and I stop/restart the postmaster, it may have a fairly high id
> number and it is quite possible that in x number of days time, the
> children will be created with a wrapped pid which is lower than the
> postmasters. Just look for the - switches that make it obvious. In fact,
> this IS currently the case right now on my server:
>
> 13081 ? S 2:30 /usr/local/pgsql/bin/postmaster
> 13082 ? S 0:19 postgres: stats buffer process
> 13083 ? S 0:28 postgres: stats collector process
> 5600 ? S 0:00 postgres: marlowe phone [local] idle
>
> In this case 13081 is my postmaster.
>
Hey Scott,
Thanks for your input !
Of course you're correct here with the possibility
of PID's rolling over - and I considered describing
exactley what you have here in my original email.
My original was getting longer than I anticipated,
so I simply thought to myself "yeah it happens, but
don't add a bunch more explanation, since the
scenario is kinda uncommon".
I should have known better ! This group is too
sharp to let anything slip through :-)
Terry
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2003-07-09 16:10 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-09 09:52 Kill Process ERROR !!! aris wendy <aris_postgre@telkom.net>
2003-07-09 04:34 ` Andrew Sullivan <andrew@libertyrms.info>
2003-07-09 12:33 ` Terry Hampton <thampton@limacorp.com>
2003-07-09 15:39 ` scott.marlowe <scott.marlowe@ihs.com>
2003-07-09 16:10 ` Terry Hampton <thampton@limacorp.com>
2003-07-09 07:54 ` andrea suisani <suisani@demetra.com>
2003-07-09 08:56 ` Andrea Suisani <andrea.suisani@opinioni.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox