pexpect 2.1 ignores SIGHUP in the forked process. This means if the parent process dies, the child lingers indefinitely.
Re: the comment in the code: in the cases this behavior is desired (launching a daemon), the daemon should ignore the SIGHUP itself. If it doesn't, then a shell wrapper can use the "nohup" command or something. But ignoring SIGHUP on all pexpect-launched processes is heavy-handed and broke my setup.
customizable SIGHUP behavior
Logged In: YES
user_id=360426
Originator: YES
I found it's actually useful to go the other way - have the child die on SIGHUP and the parent ignore it. So I've modifed my patch to make the sighup behavior customizable. I arbitrarily chose to default it to leaving sighup unchanged, though you might argue resetting it to die is better. *shrug*
File Added: pexpect-2.1-sighup.patch
Looks like someone mostly fixed this - though not as well as in my second patch - six and a half years later. Congratulations, I guess.
https://github.com/pexpect/pexpect/commit/994e4e85df6ee54cde9377d722d3f4fef53e1de2
Yes, development on pexpect more or less stopped for a few years when the original author, Noah, became busy.
I plan to allow more customisation of what happens in the forked process: https://github.com/pexpect/pexpect/issues/81