Class: InstanceAgent::LinuxUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/instance_agent/platform/linux_util.rb

Class Method Summary collapse

Class Method Details

.extract_tar(bundle_file, dst) ⇒ Object



23
24
25
26
# File 'lib/instance_agent/platform/linux_util.rb', line 23

def self.extract_tar(bundle_file, dst)
  FileUtils.mkdir_p(dst)
  execute_tar_command("/bin/tar -xpsf #{bundle_file} -C #{dst}")
end

.extract_tgz(bundle_file, dst) ⇒ Object



28
29
30
31
# File 'lib/instance_agent/platform/linux_util.rb', line 28

def self.extract_tgz(bundle_file, dst)
  FileUtils.mkdir_p(dst)
  execute_tar_command("/bin/tar -zxpsf #{bundle_file} -C #{dst}")
end

.prepare_script_command(script, absolute_path) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/instance_agent/platform/linux_util.rb', line 11

def self.prepare_script_command(script, absolute_path)
  script_command = absolute_path
  if(!script.runas.nil?)
    script_command = 'su ' + script.runas + ' -c ' + absolute_path
  end
  script_command
end

.script_executable?(path) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/instance_agent/platform/linux_util.rb', line 19

def self.script_executable?(path)
  File.executable?(path)
end

.supported_osesObject



7
8
9
# File 'lib/instance_agent/platform/linux_util.rb', line 7

def self.supported_oses()
  ['linux']
end

.supported_versionsObject



3
4
5
# File 'lib/instance_agent/platform/linux_util.rb', line 3

def self.supported_versions()
  [0.0]
end