Utility functions for processes.
|
|
|
_BuildCmdEnvironment(env,
reset)
Builds the environment for an external program. |
source code
|
|
RunResult
|
RunCmd(cmd,
env=None,
output=None,
cwd="/",
reset_env=False,
interactive=False,
timeout=None,
noclose_fds=None,
input_fd=None,
postfork_fn=None)
Execute a (shell) command. |
source code
|
|
|
|
|
|
int
|
StartDaemon(cmd,
env=None,
cwd="/",
output=None,
output_fd=None,
pidfile=None)
Start a daemon process after forking twice. |
source code
|
|
|
_StartDaemonChild(errpipe_read,
errpipe_write,
pidpipe_read,
pidpipe_write,
args,
env,
cwd,
output,
fd_output,
pidfile)
Child process for starting daemon. |
source code
|
|
|
|
|
|
|
_WaitForProcess(child,
timeout)
Waits for the child to terminate or until we reach timeout. |
source code
|
|
tuple
|
_RunCmdPipe(cmd,
env,
via_shell,
cwd,
interactive,
timeout,
noclose_fds,
input_fd,
postfork_fn=None,
_linger_timeout=constants.CHILD_LINGER_TIMEOUT)
Run a command and return its output. |
source code
|
|
int
|
_RunCmdFile(cmd,
env,
via_shell,
output,
cwd,
noclose_fds)
Run a command and save its output to a file. |
source code
|
|
list of tuples
|
RunParts(dir_name,
env=None,
reset_env=False)
Run Scripts or programs in a directory |
source code
|
|
string
|
|
list of string
|
|
boolean
|
|
boolean
|
|
set
|
|
string
|
|
bool
|
|
tuple; (int, callable)
|
|
|
KillProcess(pid,
signal_=signal.SIGTERM,
timeout=30,
waitpid=False)
Kill a process given by its pid. |
source code
|
|
bool
|
|
|
|