summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2006-03-06 20:44:29 +0000
committerhunt <hunt>2006-03-06 20:44:29 +0000
commit70404fc597fe283753bb2f86f95c4c9f008f324d (patch)
treef61d42a73603f916a178091d7fd456690c7f47fd
parentaceaf24112298270202da8a4a6b5116006ae00e3 (diff)
downloadsystemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.tar.gz
systemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.tar.xz
systemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.zip
2006-03-06 Martin Hunt <hunt@redhat.com>
* buildrun.cxx (run_pass): Add "-u username". * stapfuncs.5.in: Document system().
-rw-r--r--ChangeLog5
-rw-r--r--buildrun.cxx7
-rw-r--r--stapfuncs.5.in6
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e4f5dde8..853fc83b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-06 Martin Hunt <hunt@redhat.com>
+
+ * buildrun.cxx (run_pass): Add "-u username".
+ * stapfuncs.5.in: Document system().
+
2006-03-06 Frank Ch. Eigler <fche@elastic.org>
* stapex.5.in: Use \[aq] for plain single quotes for encoding
diff --git a/buildrun.cxx b/buildrun.cxx
index 535e31bc..c997d125 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -1,5 +1,5 @@
// build/run probes
-// Copyright (C) 2005 Red Hat Inc.
+// Copyright (C) 2005, 2006 Red Hat Inc.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -15,6 +15,7 @@
extern "C" {
#include "signal.h"
#include <sys/wait.h>
+#include <pwd.h>
}
@@ -101,11 +102,15 @@ run_pass (systemtap_session& s)
{
int rc = 0;
+ struct passwd *pw = getpwuid(getuid());
+ string username = string(pw->pw_name);
+
// for now, just spawn stpd
string stpd_cmd = string("sudo ")
+ string(PKGLIBDIR) + "/stpd "
+ (s.bulk_mode ? "" : "-r ")
+ (s.verbose>1 ? "" : "-q ")
+ + "-u " + username + " "
+ (s.output_file.empty() ? "" : "-o " + s.output_file + " ");
stpd_cmd += "-d " + stringify(getpid()) + " ";
diff --git a/stapfuncs.5.in b/stapfuncs.5.in
index 43356564..4fc673e3 100644
--- a/stapfuncs.5.in
+++ b/stapfuncs.5.in
@@ -243,6 +243,12 @@ Return an absolute timestamp value for use by the indentation function.
The default function uses
.IR gettimeofday_us
+.SS SYSTEM
+.TP
+system (cmd:string)
+Runs a command on the system. The command will run in the background
+when the current probe completes.
+
.SH FILES
.nh
.IR /usr/share/systemtap/tapset