Chapter 09/circuit-oneops-1-master/components/cookbooks/cassandra/libraries/cassandra_util.rb
#Check if the cassandra is running, allow #seconds to start running
Check if the cassandra is running, allow #seconds to start running
Check if the cassandra is running allow #seconds to start running
def cassandra_running(seconds=120)
    begin
      Timeout::timeout(seconds) do
        running = false
        while !running do
          cmd = "service cassandra status 2>&1"
          Chef::Log.info(cmd)
          result  = `#{cmd}`
            if $? == 0
              running = true
              break
            end
            sleep 5
          end
          return running
        end
      rescue Timeout::Error
        return false
      end
    end
def cassandra_running ( seconds = 120 ) begin Timeout :: timeout ( seconds ) do running = false while ! running do cmd = "service cassandra status 2>&1" Chef :: Log . info ( cmd ) result = ` #{ cmd } ` if $? == 0 running = true break end sleep 5 end return running end rescue Timeout :: Error return false end end
Check if the cassandra is running, allow #seconds to start running
Check if the cassandra is running allow #seconds to start running
seconds
<not_specific>