# File lib/daemons/monitor.rb, line 99
    def stop
      begin
        pid = @pid.pid
        Process.kill(Application::SIGNAL, pid)
                      Timeout.timeout(5, TimeoutError) do
            while Pid.running?(pid)
              sleep(0.1)
            end
          end
      rescue ::Exception => e
        $stderr.puts "exception while trying to stop monitor process #{pid}: #{e}"
        $stderr.puts "deleting pid-file."
      end

      # We try to remove the pid-files by ourselves, in case the monitor
      # didn't clean it up.
      begin; @pid.zap; rescue ::Exception; end
    end