Topic Global_Environment

Global API functions.

Functions

exec (command, capture_output) Execute command.
exec_or_die (command) Execute command, terminate on failure.
install_package (name) Install package using apt.
die (reason) Terminate execution.
Mount (mount) Mount Filesystem.
require (modulename) Load external file
read_file (filename) Read file contents.
write_file (filename, contents) Write to a file.
exists (name) Check if file exists.
isFile (name) Check if file is a file.
isDir (name) Check if file is a directory.
dirname (name) Get the path to a file.
enable_debug (filter) Enable debugging.

Tables

mount Mount point.

Callbacks

install_container () Callback executed to install container applications.
run () Callback executed to launch container applications.
background () Callback launched as daemon when container has launched.
apply_config () Callback executed to write configuration files.
init_network_needed () Callback executed to test if container neets an isolated network
init_network_host (pid) Callback executed to initialise host networking.
init_network_child () Callback executed to initialise child networking.


Functions

exec (command, capture_output) line 10
Execute command.

Parameters:

  • command string.
  • capture_output boolean return stdout instead of true/false.

Returns:

    boolean success true/false.
exec_or_die (command) line 30
Execute command, terminate on failure.

Parameters:

  • command string.

Returns:

    boolean true.
install_package (name) line 39
Install package using apt.

Parameters:

  • name string.
die (reason) line 47
Terminate execution.

Parameters:

  • reason string.
Mount (mount) line 64
Mount Filesystem.

Parameters:

  • mount mount

See also:

require (modulename) line 74
Load external file

Parameters:

  • modulename
read_file (filename) line 83
Read file contents.

Parameters:

  • filename string.

Returns:

    string
write_file (filename, contents) line 102
Write to a file.

Parameters:

  • filename string.
  • contents string.

Returns:

    0
exists (name) line 115
Check if file exists.

Parameters:

  • name string.

Returns:

    boolean
isFile (name) line 123
Check if file is a file.

Parameters:

  • name string.

Returns:

    boolean
isDir (name) line 137
Check if file is a directory.

Parameters:

  • name string.

Returns:

    boolean
dirname (name) line 144
Get the path to a file.

Parameters:

  • name string.

Returns:

    boolean
enable_debug (filter) line 152
Enable debugging.

Parameters:

  • filter string Function to debug, nil for all.

Tables

mount line 61
Mount point.

Fields:

  • type string Type of mount, "map" or "tmpfs".
  • path string Target path in container.
  • source string For type 'map', specifies the source directory on the host.
  • size string For type 'tmpfs', specifies the size of the mount.

Callbacks

Define these functions to define behaviour that should be executed at the appropriate time. If the same function is defined in multiple files then all will be executed.

Callbacks should always return 0 on success.

install_container () line 172
Callback executed to install container applications.
run () line 178
Callback executed to launch container applications.
background () line 184
Callback launched as daemon when container has launched.
apply_config () line 190
Callback executed to write configuration files.
init_network_needed () line 221
Callback executed to test if container neets an isolated network

Returns:

    1 to initialise networking, 0 otherwise
init_network_host (pid) line 227
Callback executed to initialise host networking.

Parameters:

  • pid int PID of container.
init_network_child () line 233
Callback executed to initialise child networking.
generated by LDoc 1.4.6 Last updated 2019-03-17 07:38:48