           console.log "couldn't delete previous process tree at #{previouschildProcessesContainerDir}"
         #else
         #  console.log "previous process tree is deleted."
+        
   fork: (options,callback) ->
     options.fork = yes
     @run options,callback, (cb) =>

        console.log "[PROCESSES][#{name}]it's time you die process:#{name}" if verbose
        @kill name
      ,die.after


    @child.on 'exit', ()=>
      console.log "[PROCESSES][#{name}] did exit." if verbose

catch e
  # do nothing, probably dir is already there.

################################
### HANDLE SIGNALS and KILLS ###
################################

# when doing ctrl+c 
process.on 'SIGINT', =>
  console.log "\nkilled via ctrl+c. this should not happen"
  process.exit(0)

# guaranteed death.
process.on 'SIGTERM', =>
  console.log "going down"
  process.exit(0)

class Processes extends EventEmitter
  constructor:(options={})->
    {main}         = options
    @list          = {}
    @child         = null
    @workerProcess = {}
    @childProcessesContainerDir = __dirname+"/.tmp"
    if main
