diff --git a/library/systemd/src/lib/yast2/systemctl.rb b/library/systemd/src/lib/yast2/systemctl.rb index 41973e5e4..11c5367d1 100644 --- a/library/systemd/src/lib/yast2/systemctl.rb +++ b/library/systemd/src/lib/yast2/systemctl.rb @@ -24,6 +24,8 @@ module Systemctl TIMEOUT = 30 # seconds class << self + BASH_SCR_PATH = Yast::Path.new(".target.bash_output") + # @param command [String] # @return [#command,#stdout,#stderr,#exit] # @raise [SystemctlError] if it times out @@ -31,7 +33,7 @@ def execute(command) log.info("systemctl #{command}") command = SYSTEMCTL + command log.debug "Executing `systemctl` command: #{command}" - result = timeout(TIMEOUT) { SCR.Execute(Path.new(".target.bash_output"), command) } + result = timeout(TIMEOUT) { SCR.Execute(BASH_SCR_PATH, command) } OpenStruct.new(result.merge!(command: command)) rescue Timeout::Error raise SystemctlError, "Timeout #{TIMEOUT} seconds: #{command}"