lib/kurchatov/mixin/runit_service.rb in kurchatov-0.1.4 vs lib/kurchatov/mixin/runit_service.rb in kurchatov-0.1.5
- old
+ new
@@ -9,8 +9,14 @@
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