Class: OsCtld::ContainerControl::Commands::WithMountns::Frontend

Inherits:
Frontend
  • Object
show all
Defined in:
lib/osctld/container_control/commands/with_mountns.rb

Instance Attribute Summary

Attributes inherited from Frontend

#command_class, #ct

Instance Method Summary collapse

Methods inherited from Frontend

#exec_runner, #fork_runner, #initialize

Constructor Details

This class inherits a constructor from OsCtld::ContainerControl::Frontend

Instance Method Details

#execute(opts) ⇒ Object

Parameters:

  • opts (Hash)

Options Hash (opts):



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/osctld/container_control/commands/with_mountns.rb', line 18

def execute(opts)
  ct.mount

  ret = fork_runner(
    args: [{
      ctrc: opts.fetch(:ctrc, ct.get_run_conf),
      ns_pid: opts[:ns_pid],
      chroot: opts[:chroot],
      switch_to_system: opts.fetch(:switch_to_system, true),
      block: opts[:block]
    }],
    switch_to_system: false
  )
  ret.ok? ? ret.data : ret
end