Method: Chef::Provider::Service::Upstart#start_service

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

#start_serviceObject



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/chef/provider/service/upstart.rb', line 153

def start_service
  # Calling start on a service that is already started will return 1
  # Our 'goal' when we call start is to ensure the service is started
  if @upstart_service_running
    logger.trace("#{@new_resource} already running, not starting")
  else
    if @new_resource.start_command
      super
    else
      shell_out!("/sbin/start #{@job}", default_env: false)
    end
  end

  @upstart_service_running = true
end