# File lib/daemons/monitor.rb, line 118
    def stop
      begin
        pid = @pid.pid
        Process.kill(Application::SIGNAL, pid)
                Timeout::timeout(5) {      
          while Pid.running?(pid)
            sleep(0.1)
          end
        }
      rescue ::Exception => e
        puts "#{e} #{pid}"
        puts "deleting pid-file."
      end
      
      # We try to remove the pid-files by ourselves, in case the application
      # didn't clean it up.
      begin; @pid.cleanup; rescue ::Exception; end
    end