diff options
Diffstat (limited to 'net-mgmt/net-snmp-devel/files/patch-local:fixproc')
-rw-r--r-- | net-mgmt/net-snmp-devel/files/patch-local:fixproc | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/net-mgmt/net-snmp-devel/files/patch-local:fixproc b/net-mgmt/net-snmp-devel/files/patch-local:fixproc deleted file mode 100644 index fa0f3fb65767..000000000000 --- a/net-mgmt/net-snmp-devel/files/patch-local:fixproc +++ /dev/null @@ -1,90 +0,0 @@ ---- local/fixproc.orig Wed May 25 01:23:54 2005 -+++ local/fixproc Wed Nov 30 12:16:05 2005 -@@ -1,4 +1,4 @@ --#!/usr/bin/perl -+#!%%PERL%% - # - # fixproc [-min n] [-max n] [-check | -kill | -restart | -exist | -fix] proc ... - # -@@ -131,7 +131,7 @@ - - use File::Temp qw(tempfile); - --$database_file = '/local/etc/fixproc.conf'; -+$database_file = '%%PREFIX%%/etc/fixproc.conf'; - - $debug = 0; # specify debug level using -dN - # currently defined: -d1 -@@ -157,6 +157,14 @@ - $shell_header = "#!/bin/sh\n"; - $shell_end_marker = 'shell_end_marker'; - -+open(command, "/bin/ps -p $$ |") || die "$0: can't run ps command\n"; -+if (split(' ', <command>) > 4) { -+ $ps_opts = 'ax'; -+} else { -+ $ps_opts = '-e'; -+} -+close command; -+ - &read_args(); - &read_database(); - # &dump_database(); # debug only -@@ -305,41 +313,47 @@ - - # first try kill - $! = $fixproc_error; -- open (COMMAND, "/bin/ps -e | /bin/grep $proc |") -+ open (COMMAND, "/bin/ps $ps_opts |") - || die "$0: can't run ps-grep-awk command\n"; - while (<COMMAND>) - { -- # match the first field of ps -e -+ if /$proc/ { -+ # match the first field of ps $ps_opts - $! = $fixproc_error; -- /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n"; -- system "kill $1"; -+ /^\s*(\d+)\s/ || die "$0: can't match ps $ps_opts output\n"; -+ kill 15, $1; -+ } - } -+ close COMMAND; - - # if process still exist, try kill -9 - sleep 2; - $! = $fixproc_error; -- open (COMMAND, "/bin/ps -e | /bin/grep $proc |") -+ open (COMMAND, "/bin/ps $ps_opts |") - || die "$0: can't run ps-grep-awk command\n"; - $second_kill_needed = 0; - while (<COMMAND>) - { -- # match the first field of ps -e -+ if /$proc/ { -+ # match the first field of ps $ps_opts - $! = $fixproc_error; -- /^\s*(\d+)\s/ || die "$0: can't match ps -e output\n"; -- system "kill -9 $1"; -+ /^\s*(\d+)\s/ || die "$0: can't match ps $ps_opts output\n"; -+ kill 9, $1; - $second_kill_needed = 1; - } -+ close COMMAND; - return ($no_error) if ($second_kill_needed == 0); - - # see if kill -9 worked - sleep 2; - $! = $fixproc_error; -- open (COMMAND, "/bin/ps -e | /bin/grep $proc |") -+ open (COMMAND, "/bin/ps $ps_opts |") - || die "$0: can't run ps-grep-awk command\n"; - while (<COMMAND>) - { # a process still exist, return error -- return $cannot_kill_error; -+ return $cannot_kill_error if /$proc/; - } -+ close COMMAND; - return $no_error; # good, all dead - } - |