This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: RFC: stapclean shell script
- From: David Smith <dsmith at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Mon, 14 Jan 2008 10:26:34 -0600
- Subject: Re: RFC: stapclean shell script
- References: <20080113032555.GC15218@redhat.com>
Frank Ch. Eigler wrote:
> Hi -
>
> A problem I was debugging today sometimes left zombie stapio processes
> running and associated stap_* modules in the kernel. The following
> little script helped clean up the machine between debugging runs. Do
> you think it'd be worth distributing in the source tree?
>
> - FChE
>
>
> #! /bin/sh
>
> PATH=/usr/bin:/usr/sbin:/sbin:/bin
>
> killall -v -q stapio
> killall -v -q staprun
> sleep 2
> killall -q -9 stapio
> killall -q -9 staprun
> lsmod | grep "^stap_" | awk '{print $1}' | xargs -r rmmod -v
The script looks useful, but you've also added several dependencies to
the systemtap-runtime rpm (where I'd guess this script would go):
psmisc (for 'killall')
coreutils (for 'sleep')
module-init-tools (for 'lsmod' and 'rmmod')
grep
gawk (for 'awk')
findutils (for 'xargs')
I wonder if it is possible to build a locked-down production server with
any of the above missing.
Should the script check for the user being root before doing anything?
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)