Loading...
Searching...
No Matches
lxc_attach_options_t Struct Reference

`#include <attach_options.h>`

Collaboration diagram for lxc_attach_options_t:
[legend]

## Data Fields

int | attach_flags
int | namespaces
long | personality
char * | initial_cwd
uid_t | uid
gid_t | gid
lxc_attach_env_policy_t | env_policy
char ** | extra_env_vars
char ** | extra_keep_env
int | log_fd
char * | lsm_label
lxc_groups_t | groups
int | stdin_fd
int | stdout_fd
int | stderr_fd

## Detailed Description

LXC attach options for lxc_container `attach()`.

## Field Documentation

## attach_flags

int lxc_attach_options_t::attach_flags

Any combination of LXC_ATTACH_* flags

## env_policy

lxc_attach_env_policy_t lxc_attach_options_t::env_policy

Environment policy

## extra_env_vars

char** lxc_attach_options_t::extra_env_vars

Extra environment variables to set in the container environment

## extra_keep_env

char** lxc_attach_options_t::extra_keep_env

Names of environment variables in existing environment to retain in container environment.

## gid

gid_t lxc_attach_options_t::gid

The group-id to run as.

Note
  Set to `-1` for default behaviour (init gid for userns containers or `0` (super-user) if detection fails).

## groups

lxc_groups_t lxc_attach_options_t::groups

The additional group GIDs to run with.

If unset all additional groups are dropped.

## initial_cwd

char* lxc_attach_options_t::initial_cwd

Initial current directory, use `NULL` to use cwd. If the current directory does not exist in the container, the root directory will be used instead because of kernel defaults.

## log_fd

int lxc_attach_options_t::log_fd

File descriptor to log output.

## lsm_label

char* lxc_attach_options_t::lsm_label

lsm label to set.

## namespaces

int lxc_attach_options_t::namespaces

The namespaces to attach to (CLONE_NEW... flags)

## personality

long lxc_attach_options_t::personality

Initial personality (`LXC_ATTACH_DETECT_PERSONALITY` to autodetect).

Warning
  This may be ignored if lxc is compiled without personality support)

## stderr_fd

int lxc_attach_options_t::stderr_fd

stderr file descriptor

## stdin_fd

int lxc_attach_options_t::stdin_fd

File descriptors for stdin, stdout and stderr, `dup2()` will be used before calling exec_function, (assuming not `0`, `1` and `2` are specified) and the original fds are closed before passing control over. Any `O_CLOEXEC` flag will be removed after that. stdin file descriptor

## stdout_fd

int lxc_attach_options_t::stdout_fd

stdout file descriptor

## uid

uid_t lxc_attach_options_t::uid

The user-id to run as.

Note
  Set to `-1` for default behaviour (init uid for userns containers or `0` (super-user) if detection fails).

The documentation for this struct was generated from the following file:

- attach_options.h