Method: Chef::Provider::Service::Arch#disable_service

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

#disable_serviceObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/chef/provider/service/arch.rb', line 90

def disable_service()
  new_daemons = []
  entries = daemons

  if entries.include?("!#{new_resource.service_name}")
    # exists and disabled
    # new_daemons += entries
  else
    if entries.include?(new_resource.service_name) or entries.include?("@#{new_resource.service_name}")
      # exists but enabled (or enabled as a back-ground service)
      # FIXME: Does arch support !@foobar ?
      entries.each do |daemon|
        if [new_resource.service_name, "@#{new_resource.service_name}"].include?(daemon)
          new_daemons << "!#{new_resource.service_name}"
        else
          new_daemons << daemon
        end
      end
    end
    update_daemons(new_daemons)
  end
end