summaryrefslogtreecommitdiff
path: root/lib/util/util.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-17 18:18:05 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-17 19:43:32 +1100
commit8756e130098254564ebbfb878efdc9f2a24a0696 (patch)
tree9934a529941d3afc50762f063b4ef830d04989c6 /lib/util/util.h
parent5c716146e8aee16b46a2144c199b922c13fd00ba (diff)
downloadsamba-8756e130098254564ebbfb878efdc9f2a24a0696.tar.gz
samba-8756e130098254564ebbfb878efdc9f2a24a0696.tar.bz2
samba-8756e130098254564ebbfb878efdc9f2a24a0696.zip
util: added samba_runcmd()
This allows us to run a child command in an async fashion, with control over logging of stdout and stderr (which appears in the Samba log file). This is useful for ensuring we don't miss important messages from rndc commands (for example). Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/util/util.h')
-rw-r--r--lib/util/util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/util/util.h b/lib/util/util.h
index da9776163a..795bd9b744 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -875,5 +875,22 @@ bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid,
bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
gid_t **gids, size_t *num_gids);
+/*
+ run a command as a child process, with a timeout.
+
+ any stdout/stderr from the child will appear in the Samba logs with
+ the specified log levels
+
+ If callback is set then the callback is called on completion
+ with the return code from the command
+ */
+struct tevent_context;
+struct composite_context *samba_runcmd(struct tevent_context *ev,
+ TALLOC_CTX *mem_ctx,
+ struct timeval timeout,
+ int stdout_log_level,
+ int stderr_log_level,
+ const char *arg0, ...);
+
#endif /* _SAMBA_UTIL_H_ */