Class: InstanceAgent::LinuxUtil
- Inherits:
-
Object
- Object
- InstanceAgent::LinuxUtil
- Defined in:
- lib/instance_agent/platform/linux_util.rb
Class Method Summary collapse
- .extract_tar(bundle_file, dst) ⇒ Object
- .extract_tgz(bundle_file, dst) ⇒ Object
- .prepare_script_command(script, absolute_path) ⇒ Object
- .script_executable?(path) ⇒ Boolean
- .supported_oses ⇒ Object
- .supported_versions ⇒ Object
- .supports_process_groups? ⇒ Boolean
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
19 20 21 |
# File 'lib/instance_agent/platform/linux_util.rb', line 19 def self.script_executable?(path) File.executable?(path) end |
.supported_oses ⇒ Object
7 8 9 |
# File 'lib/instance_agent/platform/linux_util.rb', line 7 def self.supported_oses() ['linux'] end |
.supported_versions ⇒ Object
3 4 5 |
# File 'lib/instance_agent/platform/linux_util.rb', line 3 def self.supported_versions() [0.0] end |
.supports_process_groups? ⇒ Boolean
33 34 35 |
# File 'lib/instance_agent/platform/linux_util.rb', line 33 def self.supports_process_groups?() true end |