jail

package
v0.0.0-...-b5be2f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2019 License: MPL-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJailActive

func IsJailActive(jailname string) bool

func Jailcmd

func Jailcmd(params map[string]string) error

func Jailrctl

func Jailrctl(jname string, params map[string]uint) error

func NewJailDriver

func NewJailDriver(logger hclog.Logger) drivers.DriverPlugin

Types

type Config

type Config struct {
}

Config is the driver configuration set by the SetConfig RPC call

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func (*Driver) Capabilities

func (d *Driver) Capabilities() (*drivers.Capabilities, error)

func (*Driver) ConfigSchema

func (d *Driver) ConfigSchema() (*hclspec.Spec, error)

func (*Driver) DestroyTask

func (d *Driver) DestroyTask(taskID string, force bool) error

func (*Driver) ExecTask

func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)

func (*Driver) Fingerprint

func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

func (*Driver) InspectTask

func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)

func (*Driver) PluginInfo

func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)

func (*Driver) RecoverTask

func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error

func (*Driver) SetConfig

func (d *Driver) SetConfig(cfg *base.Config) error

func (*Driver) Shutdown

func (d *Driver) Shutdown(ctx context.Context) error

func (*Driver) SignalTask

func (d *Driver) SignalTask(taskID string, signal string) error

func (*Driver) StartTask

func (*Driver) StopTask

func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error

func (*Driver) TaskConfigSchema

func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)

func (*Driver) TaskEvents

func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

func (*Driver) TaskStats

func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)

func (*Driver) WaitTask

func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

type Rctl

type Rctl struct {
	Cputime         uint `codec:"Cputime"`
	Datasize        uint `codec:"Datasize"`
	Coredumpsize    uint `codec:"Coredumpsize"`
	Stacksize       uint `codec:"Stacksize"`
	Memoryuse       uint `codec:"Memoryuse"`
	Memorylocked    uint `codec:"Memorylocked"`
	Maxproc         uint `codec:"Maxproc"`
	Openfiles       uint `codec:"Openfiles"`
	Vmemoryuse      uint `codec:"Vmemoryuse"`
	Pseudoterminals uint `codec:"Pseudoterminals"`
	Swapuse         uint `codec:"Swapuse"`
	Nthr            uint `codec:"Nthr"`
	Msgqqueued      uint `codec:"Msgqqueued"`
	Msgqsize        uint `codec:"Msgqsize"`
	Nmsgq           uint `codec:"Nmsgq"`
	Nsemop          uint `codec:"Nsemop"`
	Nshm            uint `codec:"Nshm"`
	Shmsize         uint `codec:"Shmsize"`
	Wallclock       uint `codec:"Wallclock"`
	Pcpu            uint `codec:"Pcpu"`
	Readbps         uint `codec:"Readbps"`
	Writebps        uint `codec:"Writebps"`
	Readiops        uint `codec:"Readiops"`
	Writeiops       uint `codec:"Writeiops"`
}

type TaskConfig

type TaskConfig struct {
	Path                  string `codec:"Path"`
	Jid                   string `codec:"Jid"`
	Ip4_addr              string `codec:"Ip4_addr"`
	Ip4_saddrsel          bool   `codec:"Ip4_saddrsel"`
	Ip4                   string `codec:"Ip4"`
	Ip6_addr              string `codec:"Ip6_addr"`
	Ip6_saddrsel          bool   `codec:"Ip6_saddrsel"`
	Ip6                   string `codec:"Ip6"`
	Vnet                  string `codec:"Vnet"`
	Host_hostname         string `codec:"Host_hostname"`
	Host                  string `codec:"Host"`
	Securelevel           string `codec:"Securelevel"`
	Devfs_ruleset         string `codec:"Devfs_ruleset"`
	Children_max          uint   `codec:"Children_max"`
	Children_cur          uint   `codec:"Children_cur"`
	Enforce_statfs        uint   `codec:"Enforce_statfs"`
	Persist               bool   `codec:"Persist"`
	Osrelease             string `codec:"Osrelease"`
	Osreldate             string `codec:"Osreldate"`
	Allow_set_hostname    bool   `codec:"Allow_set_hostname"`
	Allow_sysvipc         bool   `codec:"Allow_sysvipc"`
	Allow_raw_sockets     bool   `codec:"Allow_raw_sockets"`
	Allow_chflags         bool   `codec:"Allow_chflags"`
	Allow_mount           bool   `codec:"Allow_mount"`
	Allow_mount_devfs     bool   `codec:"Allow_mount.devfs"`
	Allow_quotas          bool   `codec:"Allow_quotas"`
	Allow_read_msgbuf     bool   `codec:"Allow_read_msgbuf"`
	Allow_socket_af       bool   `codec:"Allow_socket_af"`
	Allow_reserved_ports  bool   `codec:"Allow_reserved_ports"`
	Allow_mlock           bool   `codec:"Allow_mlock"`
	Allow_mount_fdescfs   bool   `codec:"Allow_mount_fdescfs"`
	Allow_mount_fusefs    bool   `codec:"Allow_mount_fusefs"`
	Allow_mount_nullfs    bool   `codec:"Allow_mount_nullfs"`
	Allow_mount_procfs    bool   `codec:"Allow_mount_procfs"`
	Allow_mount_linprocfs bool   `codec:"Allow_mount_linprocfs"`
	Allow_mount_linsysfs  bool   `codec:"Allow_mount_linsysfs"`
	Allow_mount_tmpfs     bool   `codec:"Allow_mount_tmpfs"`
	Allow_mount_zfs       bool   `codec:"Allow_mount_zfs"`
	Allow_vmm             bool   `codec:"Allow_vmm"`
	Linux                 string `codec:"Linux"`
	Linux_osname          string `codec:"Linux_osname"`
	Linux_osrelease       string `codec:"Linux_osrelease"`
	Linux_oss_version     string `codec:"Linux_oss_version"`
	Sysvmsg               string `codec:"Sysvmsg"`
	Sysvsem               string `codec:"Sysvsem"`
	Sysvshm               string `codec:"Sysvshm"`
	Exec_prestart         string `codec:"Exec_prestart"`
	Exec_prestop          string `codec:"Exec_prestop"`
	Exec_created          string `codec:"Exec_created"`
	Exec_start            string `codec:"Exec_start"`
	Exec_stop             string `codec:"Exec_stop"`
	Command               string `codec:"Command"`
	Exec_poststart        string `codec:"Exec_postart"`
	Exec_poststop         string `codec:"Exec_poststop"`
	Exec_clean            bool   `codec:"Exec_clean"`
	Exec_jail_user        string `codec:"Exec_jail_user"`
	Exec_system_jail_user string `codec:"Exec_system_jail_user"`
	Exec_system_user      string `codec:"Exec_system_user"`
	Exec_timeout          uint   `codec:"Exec_timeout"`
	Exec_consolelog       string `codec:"Exec_consolelog"`
	Exec_fib              string `codec:"Exec_fib"`
	Stop_timeout          uint   `codec:"Stop_timeout"`
	Nic                   string `codec:"Nic"`
	Vnet_nic              string `codec:"Vnet_nic"`
	Ip_hostname           string `codec:"Ip_hostname"`
	Mount                 bool   `codec:"Mount"`
	Mount_fstab           string `codec:"Mount_fstab"`
	Mount_devfs           bool   `codec:"Mount_devfs"`
	Mount_fdescfs         bool   `codec:"Mount_fdescfs"`
	Depend                string `codec:"Depend"`
	Rctl                  Rctl   `codec:"Rctl"`
}

TaskConfig is the driver configuration of a task within a job

type TaskState

type TaskState struct {
	TaskConfig    *drivers.TaskConfig
	ContainerName string
	StartedAt     time.Time
}

TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the task state and handler during recovery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL