Menu

#8 Customizable SIGHUP behavior

Unstable (example)
closed
nobody
None
5
2014-08-10
2007-01-31
Scott Lamb
No

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.

Discussion

  • Scott Lamb

    Scott Lamb - 2007-02-26

    customizable SIGHUP behavior

     
  • Scott Lamb

    Scott Lamb - 2007-02-26
    • summary: Don't ignore SIGHUP --> Customizable SIGHUP behavior
     
  • Scott Lamb

    Scott Lamb - 2007-02-26

    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

     
  • Thomas Kluyver

    Thomas Kluyver - 2014-08-10

    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

     
  • Thomas Kluyver

    Thomas Kluyver - 2014-08-10
    • status: open --> closed
    • Group: --> Unstable (example)
     

Log in to post a comment.