Class: OsCtl::ExportFS::Operations::Server::CGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/osctl/exportfs/operations/server/cgroup.rb

Constant Summary collapse

CONTROLLER =
'systemd'
PATH =
'osctl/exportfs/server'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#execute, run

Constructor Details

#initialize(server) ⇒ CGroup

Returns a new instance of CGroup.

Parameters:



9
10
11
12
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 9

def initialize(server)
  @server = server
  @cgroup = OsCtl::ExportFS::CGroup.new(CONTROLLER, PATH)
end

Instance Attribute Details

#cgroupObject (readonly, protected)

Returns the value of attribute cgroup.



30
31
32
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 30

def cgroup
  @cgroup
end

#serverObject (readonly, protected)

Returns the value of attribute server.



30
31
32
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 30

def server
  @server
end

Instance Method Details

#clear_payloadObject



24
25
26
27
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 24

def clear_payload
  cgroup.kill_all_until_empty(payload_path)
  cgroup.destroy(payload_path)
end

#enter_managerObject



14
15
16
17
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 14

def enter_manager
  cgroup.create(path)
  cgroup.enter(path)
end

#enter_payloadObject



19
20
21
22
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 19

def enter_payload
  cgroup.create(payload_path)
  cgroup.enter(payload_path)
end

#pathObject (protected)



32
33
34
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 32

def path
  server.name
end

#payload_pathObject (protected)



36
37
38
# File 'lib/osctl/exportfs/operations/server/cgroup.rb', line 36

def payload_path
  File.join(server.name, 'payload')
end