def stop

      if running?

        Process.kill(@signal, @pid)
        FileUtils.rm(@pid_file)

        execute_callback(:stop)

        begin
          Process.wait(@pid)
        rescue Errno::ECHILD
        end

        @timeout.downto(0) do
          sleep 1
          exit unless running?
        end

        Process.kill 9, @pid if running?
        execute_callback(:after_stop)

      else
        FileUtils.rm(@pid_file) if File.exists?(@pid_file)
        log(:info, "\"#{@name}\" PID file not found.")
      end

    rescue Errno::ENOENT
    end
def stop

      if running?

        Process.kill(@signal, @pid)
        FileUtils.rm(@pid_file)

        execute_callback(:stop)

        begin
          Process.wait(@pid)
        rescue Errno::ECHILD
        end

        @timeout.downto(0) do
          sleep 1
          exit unless running?
        end

        Process.kill 9, @pid if running?
        execute_callback(:after_stop)

      else
        FileUtils.rm(@pid_file) if File.exists?(@pid_file)
        log(:info, "\"#{@name}\" PID file not found.")
      end

    rescue Errno::ENOENT
    end
Stop

 Stop daemon and remove pid file