Class: OsCtld::ContainerControl::Commands::Stop::Frontend
- Defined in:
- lib/osctld/container_control/commands/stop.rb
Instance Attribute Summary
Attributes inherited from Frontend
Instance Method Summary collapse
Methods inherited from Frontend
Constructor Details
This class inherits a constructor from OsCtld::ContainerControl::Frontend
Instance Method Details
#execute(mode, opts = {}) ⇒ true
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/osctld/container_control/commands/stop.rb', line 19 def execute(mode, opts = {}) if !%i(stop shutdown kill).include?(mode) raise ArgumentError, "invalid stop mode '#{mode}'" end CGroup.thaw_tree(ct.cgroup_path) if mode == :kill ret = pipe_runner(args: [mode, opts]) if ret.ok? true elsif mode == :stop CGroup.thaw_tree(ct.cgroup_path) ret = pipe_runner(args: [:kill, opts]) ret.ok? || ret else ret end end |