This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: stapclean shell script


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]