Class: OsCtl::ExportFS::Operations::Server::CGroup
- Defined in:
- lib/osctl/exportfs/operations/server/cgroup.rb
Constant Summary collapse
- PATH =
'osctl/exportfs/server'.freeze
Instance Attribute Summary collapse
-
#cgroup ⇒ Object
readonly
protected
Returns the value of attribute cgroup.
-
#server ⇒ Object
readonly
protected
Returns the value of attribute server.
Instance Method Summary collapse
- #clear_all ⇒ Object
- #clear_manager ⇒ Object
- #clear_payload ⇒ Object
- #enter_manager ⇒ Object
- #enter_payload ⇒ Object
-
#initialize(server) ⇒ CGroup
constructor
A new instance of CGroup.
- #manager_path ⇒ Object protected
- #path ⇒ Object protected
- #payload_path ⇒ Object protected
Methods inherited from Base
Constructor Details
Instance Attribute Details
#cgroup ⇒ Object (readonly, protected)
Returns the value of attribute cgroup.
51 52 53 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 51 def cgroup @cgroup end |
#server ⇒ Object (readonly, protected)
Returns the value of attribute server.
51 52 53 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 51 def server @server end |
Instance Method Details
#clear_all ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 33 def clear_all begin clear_manager rescue Errno::ENOENT # ignore end begin clear_payload rescue Errno::ENOENT # ignore end nil end |
#clear_manager ⇒ Object
19 20 21 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 19 def clear_manager cgroup.destroy(manager_path) end |
#clear_payload ⇒ Object
28 29 30 31 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 28 def clear_payload cgroup.kill_all_until_empty(payload_path) cgroup.destroy(payload_path) end |
#enter_manager ⇒ Object
14 15 16 17 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 14 def enter_manager cgroup.create(manager_path) cgroup.enter(manager_path) end |
#enter_payload ⇒ Object
23 24 25 26 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 23 def enter_payload cgroup.create(payload_path) cgroup.enter(payload_path) end |
#manager_path ⇒ Object (protected)
57 58 59 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 57 def manager_path File.join(server.name, 'manager') end |
#path ⇒ Object (protected)
53 54 55 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 53 def path server.name end |
#payload_path ⇒ Object (protected)
61 62 63 |
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 61 def payload_path File.join(server.name, 'payload') end |