public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "hunt at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sources.redhat.com
Subject: [Bug runtime/6030] stap, staprun, stapio interaction quirks: stale module left unloaded
Date: Fri, 04 Apr 2008 21:10:00 -0000	[thread overview]
Message-ID: <20080404154314.26116.qmail@sourceware.org> (raw)
In-Reply-To: <20080404085514.6030.ananth@in.ibm.com>


------- Additional Comments From hunt at redhat dot com  2008-04-04 15:43 -------
Subject: Re:  stap, staprun, stapio interaction quirks:
	stale 	module left unloaded


On Fri, 2008-04-04 at 17:16 +0530, Ananth N Mavinakayanahalli wrote:
> > We cannot reasonably recover from a kill -9 on staprun.  That is the only
> > privileged process that can unload the module.  It may have been hand-started,
> > leaving none of our code available to watch over it and restart it.  Teaching
> > stap to re-fork staprun another time is perhaps possible, but in your
> > "kill -9 stap staprun" scenario, that wouldn't help either.
> 
> Agreed. SIGKILL is a box case. SIGINT/SIGHUP can be handled though.
> 
> > Perhaps it's time to reconsider including a script such as
> > http://sourceware.org/ml/systemtap/2008-q1/msg00051.html
> > in the distribution.  Or a cron-driven systemtap module cleaner/unloader.
> 
> Yeah. That'd work too.

cron wouldn't work well. If you wanted to run the same script you would
not be able to until cron had triggered the cleanup.  As a user, I find
stuff like that extremely annoying.

I still prefer the solution I described here
http://sources.redhat.com/bugzilla/show_bug.cgi?id=5716

"I think a simpler, more secure approach would be to simply separate the
module removal and build it as a standalone suid program.  It would
check the user was in stapusr or stapdev, verify the module that was
requested to be unloaded was a systemtap module, then unload it.  That
allows staprun to do some quick setup, load the module, then drop all
capabilities (if we use them), fork stapio, and exit. Stapio would exec
the module unloader when it got ^C or an exit message from the module."

So staprun goes away and cannot be killed. SIGKILL on stapio would still
leave the module installed, of course. So then you would run the
unloader by hand. What would we call it? staprm?  Or it could just be
staprun with a flag to unload instead of load.

We could add an option to remove all systemtap modules.

Is there a simple way to tell which systemtap scripts are running and
who owns them?  We could easily add that too.






-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6030

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

  parent reply	other threads:[~2008-04-04 15:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 11:19 [Bug runtime/6030] New: " ananth at in dot ibm dot com
2008-04-04 11:46 ` [Bug runtime/6030] " fche at redhat dot com
2008-04-04 11:47   ` Ananth N Mavinakayanahalli
2008-04-04 15:43     ` Martin Hunt
2008-04-04 14:20 ` ananth at in dot ibm dot com
2008-04-04 21:10 ` hunt at redhat dot com [this message]
2008-04-08 14:13 ` ananth at in dot ibm dot com
2008-04-08 16:19 ` fche at redhat dot com
2008-07-07 20:32 ` anithra at linux dot vnet dot ibm dot com
2008-07-08 16:37 ` fche at redhat dot com
2008-07-08 19:10 ` anithra at linux dot vnet dot ibm dot com
2008-07-10 16:44 ` anithra at linux dot vnet dot ibm dot com
2008-07-10 17:05 ` fche at redhat dot com
2008-07-17 13:28   ` anithra
2008-07-17 17:48     ` Frank Ch. Eigler
2008-07-10 17:45 ` anithra at linux dot vnet dot ibm dot com
2008-07-10 18:00 ` fche at redhat dot com
2008-07-17 18:55 ` fche at redhat dot com
2008-07-23 14:41 ` anithra at linux dot vnet dot ibm dot com
2008-07-23 14:49 ` fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080404154314.26116.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).