public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* RE: systemtap question
@ 2006-09-06 18:41 Stone, Joshua I
  0 siblings, 0 replies; 5+ messages in thread
From: Stone, Joshua I @ 2006-09-06 18:41 UTC (permalink / raw)
  To: Frank Ch. Eigler, Anthony Green; +Cc: systemtap

On Wednesday, September 06, 2006 6:36 AM, Frank Ch. Eigler wrote:
> Hi -
> 
> green@redhat.com wrote:
> 
>> I have a customer who wants certain system files to have
>> non-standard file permissions, but some cron job keeps changing them
>> back every night.  He'd like to figure out who is doing this.
> 
> OK.
> 
>> Is this the kind of thing systemtap could help with?  Do you have
>> any examples that are similar to this?

Here's a tiny script that probes the chmod syscall, and prints the
calling process and walks the process "stack".  You might also have to
probe fchmod, but it's more difficult to account that since you only get
the file descriptor.

Josh


probe syscall.chmod {
  printf("%5d %-16s %s -> %#o\n", tid(), execname(), path, mode)
  printf(" ^\n")
  for (t = task_parent(task_current()); task_tid(t) != 0; t =
task_parent(t)) {
    printf(" | %5d %s\n", task_tid(t), task_execname(t))
  }
  printf(" ------------------------\n")
}

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <1157546598.2847.28.camel@localhost.localdomain>]

end of thread, other threads:[~2008-08-23 14:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <48ACFC02.3080002@gmail.com>
2008-08-23  4:28 ` systemtap question Peter Teoh
2008-08-23 12:51   ` Mark Wielaard
2008-08-23 14:09   ` Frank Ch. Eigler
2006-09-06 18:41 Stone, Joshua I
     [not found] <1157546598.2847.28.camel@localhost.localdomain>
2006-09-06 13:36 ` Frank Ch. Eigler

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).