Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#8 Customizable SIGHUP behavior

open
nobody
None
5
2007-02-26
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