Runner(name, command, owner, on_exit, path=None, as_user=None, as_group=None)¶
A class to run a process in a thread.
- name – name of the process to access it
- command – command to run the process
- owner – the user who starts this process
- on_exit – a function that will be called when the process exits
- path – Path to execeute the command in
- user – System user to switch to before starting the process
- group – System group to switch to before starting the process
Make the thread a daemon
Send the given line to all attached handlers.
Cleanup and close handlers.
messageto process’s stdin.
Switch user and group.
Start the runner.
on_linefor each line of output until it terminates. Change the directory to
pathand switch user and group (if they’re given) before running the process. Finally call
Kill the process if it exists.