ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Как убить потомка?
@ 2008-11-30 20:53 Kharitonov A. Dmitry
  2008-11-30 21:13 ` Dmitry Chistikov
  2008-12-01  9:25 ` Konstantin S. Uvarin
  0 siblings, 2 replies; 15+ messages in thread
From: Kharitonov A. Dmitry @ 2008-11-30 20:53 UTC (permalink / raw)
  To: community

Как убить потомка?
В скрипте запускается блок в фон. Идентификатор получить могу по $!, но 
убивание процесса блока кода не останавливает текущую выполняемую из 
блока команду (которую и надо убить).

Моделирование проблемы. Нужно убить sleep. 12428 - это я могу получить 
по $!. PID sleep мне из программы не доступен.

[user@eeedima installflash]$ { sleep 30; echo hello; } & ps
[1] 12428
  PID TTY          TIME CMD
 6933 pts/6    00:00:00 bash
12428 pts/6    00:00:00 bash
12429 pts/6    00:00:00 sleep
12430 pts/6    00:00:00 ps
[user@eeedima installflash]$ kill 12428
[1]+  Завершено      { sleep 100; echo hello; }
[user@eeedima installflash]$ ps
  PID TTY          TIME CMD
 6933 pts/6    00:00:00 bash
12429 pts/6    00:00:00 sleep
12452 pts/6    00:00:00 ps



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-12-01 13:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-30 20:53 [Comm] Как убить потомка? Kharitonov A. Dmitry
2008-11-30 21:13 ` Dmitry Chistikov
2008-11-30 21:23   ` Kharitonov A. Dmitry
2008-11-30 21:35     ` Dmitry Chistikov
2008-11-30 21:48       ` Kharitonov A. Dmitry
2008-11-30 21:51         ` Dmitry Chistikov
2008-11-30 21:57           ` Kharitonov A. Dmitry
2008-11-30 22:04             ` Dmitry Chistikov
2008-11-30 22:22               ` Kharitonov A. Dmitry
2008-11-30 22:34                 ` Dmitry Chistikov
2008-11-30 22:41                   ` Kharitonov A. Dmitry
2008-11-30 22:56                     ` Dmitry Chistikov
2008-11-30 23:37                       ` Kharitonov A. Dmitry
2008-12-01  9:25 ` Konstantin S. Uvarin
2008-12-01 13:52   ` Kharitonov A. Dmitry

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git