Sha256: 3ad97c96d600664503694c669ec391dc69e852858dec0f00096e01459b90ec45

Contents?: true

Size: 618 Bytes

Versions: 279

Compression:

Stored size: 618 Bytes

Contents

class Specinfra::Command::Alpine::Base::Process < Specinfra::Command::Base
  class << self
    def get(process, opts)
      col = opts[:format].chomp('=')
      if col == 'args'
        "ps -o #{col} | grep #{escape(process)} | head -1"
      else
        "ps -o #{col},args | grep -E '\\s+#{process}' | awk '{ print $1 }' | head -1"
      end
    end

    def check_is_running(process)
      "ps -ocomm | grep -w -- #{escape(process)} | grep -qv grep"
    end

    def check_count(process, count)
      "test $(ps -ocomm | grep -w -- #{escape(process)} | grep -v grep | wc -l) -eq #{escape(count)}"
    end
  end
end

Version data entries

279 entries across 279 versions & 3 rubygems

Version Path
specinfra-2.91.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.90.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.90.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.89.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.88.2 lib/specinfra/command/alpine/base/process.rb
specinfra-2.88.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.88.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.87.2 lib/specinfra/command/alpine/base/process.rb
specinfra-2.87.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.87.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.86.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.85.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.85.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.84.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.84.0 lib/specinfra/command/alpine/base/process.rb
specinfra-2.83.4 lib/specinfra/command/alpine/base/process.rb
specinfra-2.83.3 lib/specinfra/command/alpine/base/process.rb
specinfra-2.83.2 lib/specinfra/command/alpine/base/process.rb
specinfra-2.83.1 lib/specinfra/command/alpine/base/process.rb
specinfra-2.83.0 lib/specinfra/command/alpine/base/process.rb