examples/kafka-jvm/chef/cookbooks/runit/libraries/provider_runit_service.rb
# refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
def load_current_resource
          @current_resource = Chef::Resource::RunitService.new(new_resource.name)
          @current_resource.service_name(new_resource.service_name)
          Chef::Log.debug("Checking status of service #{new_resource.service_name}")
          unless ::File.exist?(new_resource.sv_bin) && ::File.executable?(new_resource.sv_bin)
            no_runit_message = "Could not locate main runit sv_bin at \"#{new_resource.sv_bin}\". "
            no_runit_message << "Did you remember to install runit before declaring a \"runit_service\" resource? "
            no_runit_message << "\n\nTry adding the following to the top of your recipe:\n\ninclude_recipe \"runit\""
            fail no_runit_message
          end
          @current_resource.running(running?)
          @current_resource.enabled(enabled?)
          @current_resource.env(get_current_env)
          @current_resource
        end
def load_current_resource @current_resource = Chef :: Resource :: RunitService . new ( new_resource . name ) @current_resource . service_name ( new_resource . service_name ) Chef :: Log . debug ( "Checking status of service #{new_resource.service_name}" ) unless :: File . exist? ( new_resource . sv_bin ) && :: File . executable? ( new_resource . sv_bin ) no_runit_message = "Could not locate main runit sv_bin at \"#{new_resource.sv_bin}\". " no_runit_message << "Did you remember to install runit before declaring a \"runit_service\" resource? " no_runit_message << "\n\nTry adding the following to the top of your recipe:\n\ninclude_recipe \"runit\"" fail no_runit_message end @current_resource . running ( running? ) @current_resource . enabled ( enabled? ) @current_resource . env ( get_current_env ) @current_resource end
refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
# verify Runit was installed properly