Страница 1 из 1

Как убить процесс?

Добавлено: 2009-05-15 13:34:10
weec
If you can't kill a process (even with SIGKILL), it means
that the process currently can't be put on the run queue,
because only processes that are able to run can receive
signals. Given that, such a situation usually has one of
these three reasons:

1. The process hangs in "disk wait" (flag "D" in ps' STAT
column). This often means there's a hardware problem
with your disk or controller (or a driver bug), or a
network problem if you use NFS.

2. The process was suspended (SIGSTOP). In this case
there is the flag "T" in ps' STAT column. Try sending
a SIGCONT to the process.

3. The process terminated, but the parent process failed
to pick up the exit code. In this case, the process
needs to retain an entry in the process table (shown
by ps) in order to record the exit code until it is
picked up, even though the process itself is gone.
Such a "dead" entry in the process table is called a
zombie process. In ps' STAT column there is the "Z"
flag. This usually indicates a programming error
(a.k.a. bug) in the parent process. You can get rid
of the zombie by killing the parent process. Then the
zombie will be inherited by the next process in the
hierarchy (up to the init process 1 if required) which
will then pick up the exit code and release the process
entry.

There can be other reasons on occasion, but those three are
the most common ones. Simply look at the STAT column in
the ps(1) output for the process in question. It will tell
you the reason why the process is stuck.

Best regards
Oliver
http://lists.freebsd.org/pipermail/free ... 82821.html
может кому пригодится
наверняка многие, из посетителей форума, сталкивались с ситуациями когда процесс не получалось завершить вручную, помогала лишь перезагрузка
вышеприведенный комментарий как раз затрагивает эти ситуации

Re: Как убить процесс?

Добавлено: 2009-05-15 16:58:35
Abigor

Код: Выделить всё

killall-9 sshd
kill 5232
kill -9 321
не то? или я чего-то не до понял?

Re: Как убить процесс?

Добавлено: 2009-05-15 20:07:44
Mox
kill -9 ??

Re: Как убить процесс?

Добавлено: 2009-05-15 22:27:50
m0ps
Mox писал(а):kill -9 ??
а что тут не так?

Re: Как убить процесс?

Добавлено: 2009-05-16 9:48:16
weec
всё просто, либо ты сталкивался с подобными случаями, либо нет
если нет, то стоит разобраться, что в коментарии написано
а гадать нет смысла

мда, постоянно приходиться натыкаться на стандартную манеру поведения, человек начинает гадать, если нет опыта (психология)

Re: Как убить процесс?

Добавлено: 2009-05-16 16:22:19
Гость
weec писал(а):может кому пригодится
это бы хорошо перевести и повесить в FAQ на wiki.lissyara.su

туда же надо еще поместить чем плохо постоянно использовать SIGKILL вместо SIGTERM

Re: Как убить процесс?

Добавлено: 2009-05-16 18:35:50
MASiK
не когда не сталкивался с проблеммой в никсах и вооще к любой системе кроме виндовс... Там если он повис то он повис...

Re: Как убить процесс?

Добавлено: 2009-05-16 22:47:06
Alex Keda
бывает.
особенно часто в курренте, особенно firefox =)
последнее время вроде прекратилось, попадётся - попробую.

Re: Как убить процесс?

Добавлено: 2009-05-17 19:51:17
garrotte
на 5.4 попадали в эту засаду.. когда mbuf заканчивались .. :)

Re: Как убить процесс?

Добавлено: 2009-05-18 11:25:52
imroot
была засада когда tunN зависал и только перезагрузка помогала, решение без перезагрузки:

Код: Выделить всё

ifconfig tunN destroy