Method: Chef::Provider::Service::Freebsd#initialize

Defined in:
lib/chef/provider/service/freebsd.rb

#initialize(new_resource, run_context) ⇒ Freebsd

Returns a new instance of Freebsd.



33
34
35
36
37
38
39
40
41
42
# File 'lib/chef/provider/service/freebsd.rb', line 33

def initialize(new_resource, run_context)
  super
  @enabled_state_found = false
  @init_command = nil
  if ::File.exist?("/etc/rc.d/#{new_resource.service_name}")
    @init_command = "/etc/rc.d/#{new_resource.service_name}"
  elsif ::File.exist?("/usr/local/etc/rc.d/#{new_resource.service_name}")
    @init_command = "/usr/local/etc/rc.d/#{new_resource.service_name}"
  end
end