ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Ctrl+C и SIGINT
@ 2006-11-09 12:19 Eugene Prokopiev
  2006-11-09 12:23 ` Maxim Tyurin
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Eugene Prokopiev @ 2006-11-09 12:19 UTC (permalink / raw)
  To: ALT Linux Community

Здравствуйте!

Есть скрипт следующего вида:

# cat /usr/bin/myservice

#!/bin/sh
sleep 1000000

Если запустить его, в ps ax появятся процессы:

14032 pts/0    S+     0:00 /bin/sh /usr/bin/myservice
14033 pts/0    S+     0:00 sleep 1000000

Если нажать Ctrl+C, они исчезнут

Теперь совершенно глупый вопрос: как сделать то же самое с помощью kill? 
Делаю так:

# ps ax
   PID TTY      STAT   TIME COMMAND
     1 ?        Ss     0:00 init [3]
25833 ?        Ss     0:00 /sbin/syslogd -u syslogd -j /var/resolv
25846 ?        Ss     0:00 /sbin/klogd -c 1 -2 -u klogd -j /var/lib/klogd
25861 ?        Ss     0:00 /usr/sbin/crond
25874 ?        Ss     0:00 /usr/sbin/xinetd -reuse -remlock
25887 ?        Ss     0:00 /usr/sbin/sshd
12622 ?        Ss     0:00 vzctl: pts/0
13647 pts/0    Ss     0:00 -bash
12794 ?        Rs     0:00 vzctl: pts/1
13819 pts/1    Ss     0:00 -bash
14036 pts/0    S+     0:00 /bin/sh /usr/bin/myservice
14037 pts/0    S+     0:00 sleep 1000000
14038 pts/1    R+     0:00 ps ax

# kill -INT 14036

# ps ax
   PID TTY      STAT   TIME COMMAND
     1 ?        Ss     0:00 init [3]
25833 ?        Ss     0:00 /sbin/syslogd -u syslogd -j /var/resolv
25846 ?        Ss     0:00 /sbin/klogd -c 1 -2 -u klogd -j /var/lib/klogd
25861 ?        Ss     0:00 /usr/sbin/crond
25874 ?        Ss     0:00 /usr/sbin/xinetd -reuse -remlock
25887 ?        Ss     0:00 /usr/sbin/sshd
12622 ?        Ss     0:00 vzctl: pts/0
13647 pts/0    Ss     0:00 -bash
12794 ?        Rs     0:00 vzctl: pts/1
13819 pts/1    Ss     0:00 -bash
14036 pts/0    S+     0:00 /bin/sh /usr/bin/myservice
14037 pts/0    S+     0:00 sleep 1000000
14039 pts/1    R+     0:00 ps ax

# kill 14036

# ps ax
   PID TTY      STAT   TIME COMMAND
     1 ?        Ss     0:00 init [3]
25833 ?        Ss     0:00 /sbin/syslogd -u syslogd -j /var/resolv
25846 ?        Ss     0:00 /sbin/klogd -c 1 -2 -u klogd -j /var/lib/klogd
25861 ?        Ss     0:00 /usr/sbin/crond
25874 ?        Ss     0:00 /usr/sbin/xinetd -reuse -remlock
25887 ?        Ss     0:00 /usr/sbin/sshd
12622 ?        Ss     0:00 vzctl: pts/0
13647 pts/0    Ss+    0:00 -bash
12794 ?        Rs     0:00 vzctl: pts/1
13819 pts/1    Ss     0:00 -bash
14037 pts/0    S      0:00 sleep 1000000
14112 pts/1    R+     0:00 ps ax

Что я делаю неправильно?

-- 
С уважением, Прокопьев Евгений


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

end of thread, other threads:[~2006-11-14  6:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-09 12:19 [Comm] Ctrl+C и SIGINT Eugene Prokopiev
2006-11-09 12:23 ` Maxim Tyurin
2006-11-10  9:07   ` Eugene Prokopiev
2006-11-10 15:04     ` Maxim Tyurin
2006-11-12 15:49       ` Eugene Prokopiev
2006-11-09 12:39 ` LVU
2006-11-10  9:05   ` Eugene Prokopiev
2006-11-10  9:34     ` LVU
2006-11-10  9:39       ` LVU
2006-11-12 15:54         ` Eugene Prokopiev
2006-11-12 16:17           ` Michael Shigorin
2006-11-13  6:30             ` Eugene Prokopiev
2006-11-13  8:36               ` Michael Shigorin
2006-11-13 11:40                 ` Eugene Prokopiev
2006-11-13 15:48                   ` Michael Shigorin
2006-11-13 10:36               ` [Comm] java Dmitry V. Levin
2006-11-13 11:55                 ` Eugene Prokopiev
2006-11-13 16:56                   ` Dmitry V. Levin
2006-11-14  6:58                     ` Eugene Prokopiev
2006-11-09 14:28 ` [Comm] Ctrl+C и SIGINT Maksim Otstavnov
2006-11-10  9:12   ` Eugene Prokopiev

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