Sha256: fc6a1747541e704389db0af312671845074d9b604e7eafd64cba8b59b5936bad

Contents?: true

Size: 652 Bytes

Versions: 21

Compression:

Stored size: 652 Bytes

Contents

Execute.define_task do
  desc "stop", "Stop rhoconnect server"
  def stop
    if windows?
      File.delete "#{rhoconnect_pid}" if system("FOR /F %A in (#{rhoconnect_pid}) do taskkill /F /PID %A")
    else
      if File.exist?("#{rhoconnect_pid}")
        pid = `cat #{rhoconnect_pid}`
        puts "Sending a QUIT signal to process #{pid}"
        system "kill -3 #{pid}"
        3.times do
          sleep 1
          return if !File.exist?("#{rhoconnect_pid}")
        end

        puts "Process #{pid} is still running. Sending a KILL signal to it ..."
        system "kill -9 #{pid}"
        File.delete(rhoconnect_pid)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 commands/rhoconnect/stop.rb
rhoconnect-7.5.1 commands/rhoconnect/stop.rb
rhoconnect-7.4.1 commands/rhoconnect/stop.rb
rhoconnect-7.1.17 commands/rhoconnect/stop.rb
rhoconnect-6.2.0 commands/rhoconnect/stop.rb
rhoconnect-6.0.11 commands/rhoconnect/stop.rb
rhoconnect-5.5.18 commands/rhoconnect/stop.rb
rhoconnect-5.5.17 commands/rhoconnect/stop.rb
rhoconnect-5.5.15 commands/rhoconnect/stop.rb
rhoconnect-5.5.0.22 commands/rhoconnect/stop.rb
rhoconnect-5.5.2 commands/rhoconnect/stop.rb
rhoconnect-5.5.0.7 commands/rhoconnect/stop.rb
rhoconnect-5.5.0.3 commands/rhoconnect/stop.rb
rhoconnect-5.5.0 commands/rhoconnect/stop.rb
rhoconnect-5.1.1 commands/rhoconnect/stop.rb
rhoconnect-4.0.4 commands/rhoconnect/stop.rb
rhoconnect-4.0.3 commands/rhoconnect/stop.rb
rhoconnect-4.0.2 commands/rhoconnect/stop.rb
rhoconnect-4.0.1 commands/rhoconnect/stop.rb
rhoconnect-4.0.0 commands/rhoconnect/stop.rb