Class: Wakame::Actor::System
- Inherits:
-
Object
- Object
- Wakame::Actor::System
show all
- Includes:
- Wakame::Actor
- Defined in:
- lib/wakame/actor/system.rb
Constant Summary
STATUS_CANCELED, STATUS_FAILED, STATUS_RUNNING, STATUS_SUCCESS
Instance Method Summary
collapse
included
Instance Method Details
#mount(dev, path, opts = {}) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/wakame/actor/system.rb', line 9
def mount(dev, path, opts={})
raise "#{path} does not exist or not directory." unless File.directory?(path)
mount_point_dev=`/bin/df "#{path}" | /usr/bin/awk 'NR==2 {print $1}'`.strip
Wakame.log.debug("#{mount_point_dev}: #{dev}, /bin/mount | awk '$3==path {print $1}' path=\"#{path}\"")
if mount_point_dev != dev
Wakame.log.debug("Mounting volume: #{dev} as #{path} (with options: #{opts})")
Wakame::Util.exec("/bin/mount -o #{mount_opts(opts)} '#{Shellwords.shellescape(dev)}' '#{Shellwords.shellescape(path)}'")
3.times do |i|
system("/bin/sync")
sleep 1.0
end
else
Wakame.log.debug("Mounting EBS volume: #{dev} as #{path} (with options: #{opts})")
end
end
|
#umount(path) ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/wakame/actor/system.rb', line 29
def umount(path)
raise "#{path} does not exist or not directory." unless File.directory?(path)
mount_point_dev=`/bin/df "#{path}" | awk 'NR==2 {print $1}'`
Wakame.log.debug("Unmounting volume: #{mount_point_dev} on #{path}")
Wakame::Util.exec("/bin/umount '#{Shellwords.shellescape(path)}'")
end
|