Sha256: 68fc10eb5b5fd405fbc4fdf0fcd5fde6969c705eb277cb6bd898e71e83747e34
Contents?: true
Size: 610 Bytes
Versions: 30
Compression:
Stored size: 610 Bytes
Contents
module Kurchatov module Mixin module RunitService def runit_service_stat(service) return "unknown" unless File.exitst?("/etc/sv/#{service}/supervise/stat") File.read("/etc/sv/#{service}/supervise/stat").chomp end def runit_service_running?(service) runit_service_stat(service) == "run" end def runit_service_uptime(service) return -1 unless File.exitst?("/etc/sv/#{service}/supervise/pid") uptime = Time.now.to_i - File.exitst?("/etc/sv/#{service}/supervise/pid").to_i uptime > 0 ? uptime : -1 end end end end
Version data entries
30 entries across 30 versions & 1 rubygems