[mdk-re] Re: [mdk-re] Re: [mdk-re] Как убить pppd?

Sergey Degtyaryov =?iso-8859-1?q?maga_=CE=C1_globetravel=2Espb=2Eru?=
Вт Апр 24 20:26:12 MSD 2001


Доброго времени суток, Dmitry,

24.04.2001 в 20:05 Вы сказали буквально следующее:

Dmitry> Убить процесс /usr/sbin/pppd можно, скажем, выполнив
Dmitry> "killall /usr/sbin/pppd". Однако делать это Вам, скорее всего, не нужно.
Dmitry> Сформулируйте задачу конкретнее, и ответ будет более точным.


Dmitry> Regards,
Dmitry>         Dmitry

О пользе чтения man, как раз. Надо было читать к killall.
Но все равно, может кому-то лень набирать /usr/sbin =)
Будем считать - практиковался.

SINOPSYS :
killcom [-l] process
-l - не убивать\показать

*killcom

#!/usr/bin/perl
foreach (@ARGV) {
push (@keys, shift @ARGV), next if /-\w/;
}
$victim = shift @ARGV;
open (PS, "ps ax |");
while (<PS>) {
($pid, $tty, $stat, $time, $command) = split (' '),last if /(\d+)\s+(\w+)\s+(\w+)\s+(.*?)\s+($victim)/;
}
close (PS);
#print getppid, $pid;
#exit;
print "No such process : $victim\n",exit if ((!$pid) || ($pid eq getppid));
print "Found process : $pid $tty $stat $time $command\n";exit if ($keys[0] eq '-l');
print "killing $command\n";
print "Killed successfully\n" if (kill 9, $pid); 


     \\|||//
     ( O O )      С уважением, Сергей
-oOOO--(_)--OOOo---------------------------------






Подробная информация о списке рассылки community