     # if we get a HUP, pass it through to our instance
     process.on "SIGHUP", => process.kill @instance.child.pid, "SIGHUP"
         
-    process.on "SIGTERM", =>
-      # need to shut down instance, but do it gracefully
-      process.kill @instance.child.pid, "SIGINT"
-            
+    process.on "SIGTERM", => @_shutDown()
+          
+    process.on "uncaughtException", => @_shutDown()
+              
     # start our new process, if the app directory exists.  if it doesn't, just 
     # watch and wait
     @_watchForDir path.resolve(@dir,"tmp/restart.txt"), => @_startUp()
 
   #----------
   
+  _shutDown: ->
+    @_notify "Lifeguard got TERM signal. Shutting down."
+    
+    # need to shut down instance, but do it gracefully
+    @instance.forceStop = true
+    process.kill @instance.child.pid, "SIGINT"
+    
+    @instance.on "exit", =>
+        @_notify "Child process has exited."
+        process.exit() 
+  
   # If our entire path doesn't yet exist, walk backward until we find the 
   # longest part that does. watch that directory for the next step in the 
   # tree to appear
   
   _watchForDir: (dir,cb) ->
-    console.log "watchForDir trying #{dir}"
     # loop our way up until we find something that exists    
     lFunc = (d,lcb) =>
       # test this

        
        @_watchForDir path.resolve(@dir,"tmp/restart.txt"), => @_startUp()
  
    @_restartInstance()
    
  #----------
  

            lFunc(d,lcb)
            
    lFunc dir, (existing) =>
      if existing == dir
        console.log "Starting up!"
        cb?()
