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

#56 hook into console abort to tear down full process tree

Release
open
Ryan Boggs
Core (11)
5
2010-06-19
2010-06-18
Ryan Brown
No

If NAnt is run from the console and Ctrl-C is pressed, the console is closed, etc... NAnt will tear down the entire process tree of spawned processes (as Ant does)

However, Job Objects (http://msdn.microsoft.com/en-us/library/ms684161%28VS.85%29.aspx) may be a cleaner approach to the issue -- but would require the external process spawning to be modified. Also, as per http://social.msdn.microsoft.com/Forums/en/windowssecurity/thread/71c9599e-a3d5-4b79-bfc1-1800565c5b8a there appears to be issues when trying to utilize Job Objects when launched from certain external programs -- possibly due to the inability to nest them.

Discussion

  • Ryan Brown
    Ryan Brown
    2010-06-18

     
    Attachments
  • Ryan Boggs
    Ryan Boggs
    2010-06-19

    Wow, thanks. I'll take a look at this in the near future.

     
  • Ryan Boggs
    Ryan Boggs
    2010-06-19

    • assigned_to: nobody --> rmboggs
     
  • Ryan Brown
    Ryan Brown
    2010-07-02

    source file missing from diff

     
    Attachments
  • Dominik Guder
    Dominik Guder
    2010-07-31

    It should be checked if this also works on mono with linux/mac machines.
    See http://www.mono-project.com/Interop_with_Native_Libraries
    The only place where currently DllImports are used is sysinfo task for versions net-1.0, net -1.1 and mono-1.0

     
  • Ryan Brown
    Ryan Brown
    2010-07-31

    It may very well tear down the process tree on Linux/Mac without any modifications (except maybe a <exec spawn="true" .../> ?)

    Linux/UNIX is generally pretty good about parent processes taking down their children in many cases.