Commit Graph

11 Commits

Author SHA1 Message Date
David Wilson 00edf0d66d core: have ExternalContext accept a config dict rather than kwargs.
The parameter lists had gotten out of control.
2018-05-23 16:24:38 +01:00
David Wilson 7c5bbc5168 setns: support changing user.
To match existing third party plugin.
2018-04-29 00:38:53 +01:00
David Wilson 1be03eb458 parent: change create_child interface.
To allow for additional arguments.
2018-04-27 03:50:03 +01:00
David Wilson e56608ab91 parent: don't wait for SIGTERM to complete. 2018-04-21 19:39:12 +01:00
David Wilson 9fe14e841c parent: reap the child process if connection fails
For example if no response is received in :attr:`connect_timeout`
seconds, the child would be left running.
2018-04-21 15:01:23 +00:00
David Wilson e43c6c531b Mostly implement hybrid TTY/socket mode for sudo and SSH.
Presently there is still no mechanism to add :attr:`tty_stream` to the
multiplexer after connection is successful, but for now it's not
expected that anything will be logged to it anyway.

Closes #148.
2018-04-18 21:40:24 +01:00
David Wilson c6284e00e9 Use subprocess to start child processes; closes #185. 2018-04-18 16:32:06 +00:00
David Wilson 4c433dbed1 parent_test: Add explanation. 2018-03-29 23:49:45 +05:45
David Wilson bde1778373 tests: merge tty_create_child() test into parent_test and fix hang 2018-03-29 23:36:50 +05:45
David Wilson 48351a1889 issue #155: parent: support Context.shutdown(), reap children on exit.
This permits graceful shutdown of individual contexts, without tearing
down everything.

Update mitogen.parent.Stream to also wait for the child to exit, to
prevent the buildup of zombie processes. This introduces a blocking wait
for process exit on the Broker thread, let's see if we can get away with
it. Chances are reasonable that it'll cause needless hangs on heavily
loaded machines.
2018-03-24 19:19:51 +05:45
Alex Willmer f4405c6bbc Split IterReadTest & WriteAllTest into test_parent
This matches their respective functions under test, which now reside in
mitogen.parent.
2018-03-19 21:58:29 +05:45