Subject: Zombie Killer

From: Ben Mehlman <[email-masked]>
Date: Mon, 18 Aug 1997 13:15:37 -0400 (EDT)

Due to popular demand (three requests since I mentioned it just an hour
ago), here's the perl script I use to kill off the ftpd's that are left
behind...

NOTE:  I am on AIX, which has the -o option on PS for customized columns. 
If your system doesn't have this it won't work.  Run form cron periodically
(every hour?).  It will kill any ftpd's more than 24 hours old.

-Ben

#!/usr/local/bin/perl

open(PS, "/bin/ps -ef -o comm,etime,pid |") || die "couldn't run /bin/ps\n";

foreach (<PS>) {
	next unless /^ftpd\S*\s+\d+-\S+\s+(\d+)/;
	print;
	print `/bin/kill $1`;
}
close(PS);

----------------------------------------------------------------------------
Ben Mehlman             The reasonable man adapts himself to the world; the 
Prodigy Services Corp   unreasonable one persists in trying to adapt the
[email-masked]   world to himself.  Therefore all progress depends on
                        the unreasonable man. -George Bernard Shaw