Copyright | (c) Nickolay Kudasov 2014 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | nickolay.kudasov@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Internal module to support options and structures to run
commands inside LXC containers.
Normally you should import System.LXC
module only.
- newtype AttachExecFn = AttachExecFn {
- getAttachExecFn :: C_lxc_attach_exec_t
- data AttachEnvPolicy
- fromAttachEnvPolicy :: Num a => AttachEnvPolicy -> a
- data AttachFlag
- fromAttachFlag :: Num a => AttachFlag -> a
- data AttachOptions = AttachOptions {
- attachFlags :: [AttachFlag]
- attachNamespaces :: Int
- attachPersonality :: Maybe Int64
- attachInitialCWD :: Maybe FilePath
- attachUID :: UserID
- attachGID :: GroupID
- attachEnvPolicy :: AttachEnvPolicy
- attachExtraEnvVars :: [String]
- attachExtraKeepEnv :: [String]
- attachStdinFD :: Fd
- attachStdoutFD :: Fd
- attachStderrFD :: Fd
- defaultAttachOptions :: AttachOptions
- data AttachCommand = AttachCommand {
- attachProgram :: FilePath
- attachArgv :: [String]
- withC'lxc_attach_options_t :: AttachOptions -> (Ptr C'lxc_attach_options_t -> IO a) -> IO a
- withC'lxc_attach_command_t :: AttachCommand -> (Ptr C'lxc_attach_command_t -> IO a) -> IO a
- attachRunCommand :: AttachExecFn
- attachRunShell :: AttachExecFn
Documentation
newtype AttachExecFn
exec
function to use for attach
.
See attachRunCommand
and attachRunShell
.
AttachExecFn | |
|
data AttachEnvPolicy
LXC environment policy.
AttachKeepEnv | Retain the environment. |
AttachClearEnv | Clear the environment. |
fromAttachEnvPolicy :: Num a => AttachEnvPolicy -> a
Convert AttachEnvPolicy
to internal representation.
data AttachFlag
Flags for attach
.
AttachMoveToCGroup | Move to cgroup. On by default. |
AttachDropCapabilities | Drop capabilities. On by default. |
AttachSetPersonality | Set personality. On by default |
AttachLSMExec | Execute under a Linux Security Module. On by default. |
AttachRemountProcSys | Remount /proc filesystem. Off by default. |
AttachLSMNow | FIXME: unknown. Off by default. |
AttachDefault | Mask of flags to apply by default. |
AttachLSM | All Linux Security Module flags. |
fromAttachFlag :: Num a => AttachFlag -> a
Convert AttachFlag
to bit flag.
data AttachOptions
LXC attach options for attach
.
- NOTE: for
stdin
,stdout
andstderr
descriptorsdup2()
will be used before callingexec_function
, (assuming not0
,1
and2
are specified) and the original fds are closed before passing control over. AnyO_CLOEXEC
flag will be removed after that.
AttachOptions | |
|
defaultAttachOptions :: AttachOptions
Default attach options to use.
data AttachCommand
Representation of a command to run in a container.
AttachCommand | |
|
withC'lxc_attach_options_t :: AttachOptions -> (Ptr C'lxc_attach_options_t -> IO a) -> IO a
Allocate lxc_attach_options_t
structure in a temporary storage.
withC'lxc_attach_command_t :: AttachCommand -> (Ptr C'lxc_attach_command_t -> IO a) -> IO a
Allocate lxc_attach_command_t
structure in a temporary storage.
attachRunCommand :: AttachExecFn
Run a command in the container.
attachRunShell :: AttachExecFn
Run a shell command in the container.