Class: OsCtld::ContainerControl::Commands::Wall::Frontend

Inherits:
Frontend
  • Object
show all
Includes:
Utils::Wall::Frontend
Defined in:
lib/osctld/container_control/commands/wall.rb

Constant Summary

Constants inherited from Frontend

Frontend::FAILED_RUNNER_GRACE

Instance Attribute Summary

Attributes inherited from Frontend

#command_class, #ct

Instance Method Summary collapse

Methods included from Utils::Wall::Frontend

#make_message

Methods inherited from Frontend

#cleanup_runner_cgroup, #exec_runner, #fork_runner, #initialize, #reap_failed_runner, #runner_result, #write_runner_failure

Constructor Details

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

Instance Method Details

#execute(message:, banner: true) ⇒ Object

Parameters:

  • message (String)
  • banner (Boolean) (defaults to: true)


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/osctld/container_control/commands/wall.rb', line 14

def execute(message:, banner: true)
  unless ct.running?
    raise ContainerControl::Error, 'container not running'
  end

  ret = exec_runner(
    args: [make_message(message, banner:)],
    switch_extra_namespaces: false
  )
  ret.ok? || ret
end