Class: OsCtld::UserControl::Commands::CtPostMount
- Inherits:
-
Base
- Object
- Commands::Base
- Base
- OsCtld::UserControl::Commands::CtPostMount
- Includes:
- OsCtl::Lib::Utils::Log
- Defined in:
- lib/osctld/user_control/commands/ct_post_mount.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Commands::Base
#client, #client_handler, #id, #opts
Instance Method Summary collapse
Methods inherited from Base
handle, #initialize, #owns_ct?, run
Methods inherited from Commands::Base
#base_execute, #call_cmd, #call_cmd!, cmd, #error, #error!, handle, #handled, #indirect?, #initialize, #manipulate, #manipulation_holder, #ok, #progress, #request_stop, run, run!
Constructor Details
This class inherits a constructor from OsCtld::UserControl::Commands::Base
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/osctld/user_control/commands/ct_post_mount.rb', line 11 def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct return error('access denied') unless owns_ct?(ct) run_conf = ct.run_conf DistConfig.run( run_conf, :post_mount, rootfs_mount: opts[:rootfs_mount], ns_pid: opts[:client_pid], ) lxcfs_worker = run_conf.lxcfs_worker lxcfs_params = lxcfs_worker && { mountpoint: lxcfs_worker.mountpoint, mount_files: lxcfs_worker.mount_files, } begin Hook.run( ct, :post_mount, rootfs_mount: opts[:rootfs_mount], ns_pid: opts[:client_pid], ) rescue HookFailed => e error(e.) else ok(lxcfs: lxcfs_params) end end |