Project

General

Profile

« Previous | Next » 

Revision 2696030a

Added by John Mitsch about 6 years ago

Fixes #23271 - use service-wait for service command

when the service-wait command is present on the system,
we should use this in favor of systemctl. This is how
the katello-service script functioned.

View differences:

definitions/features/service.rb
end
def perform_action_on_service(action, service)
command = "systemctl #{action} #{service}"
command = service_command(action, service)
if action == 'status'
status = execute(command)
puts "\n\n#{status}\n\n"
......
end
end
def service_command(action, service)
if File.exist?('/usr/sbin/service-wait') &&
!%w[enable disable].include?(action)
"service-wait #{service} #{action}"
else
"systemctl #{action} #{service}"
end
end
def action_word_modified(action)
case action
when 'status'

Also available in: Unified diff