Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateContainerSystemdUnit ¶ added in v1.6.0
func CreateContainerSystemdUnit(info *ContainerInfo, opts Options) (string, error)
CreateContainerSystemdUnit creates a systemd unit file for a container.
Types ¶
type ContainerInfo ¶ added in v1.6.0
type ContainerInfo struct {
// ServiceName of the systemd service.
ServiceName string
// Name or ID of the container.
ContainerName string
// InfraContainer of the pod.
InfraContainer string
// StopTimeout sets the timeout Podman waits before killing the container
// during service stop.
StopTimeout int
// RestartPolicy of the systemd unit (e.g., no, on-failure, always).
RestartPolicy string
// PIDFile of the service. Required for forking services. Must point to the
// PID of the associated conmon process.
PIDFile string
// GenerateTimestamp, if set the generated unit file has a time stamp.
GenerateTimestamp bool
// BoundToServices are the services this service binds to. Note that this
// service runs after them.
BoundToServices []string
// RequiredServices are services this service requires. Note that this
// service runs before them.
RequiredServices []string
// PodmanVersion for the header. Will be set internally. Will be auto-filled
// if left empty.
PodmanVersion string
// Executable is the path to the podman executable. Will be auto-filled if
// left empty.
Executable string
// TimeStamp at the time of creating the unit file. Will be set internally.
TimeStamp string
// New controls if a new container is created or if an existing one is started.
New bool
// CreateCommand is the full command plus arguments of the process the
// container has been created with.
CreateCommand []string
// RunCommand is a post-processed variant of CreateCommand and used for
// the ExecStart field in generic unit files.
RunCommand string
}
ContainerInfo contains data required for generating a container's systemd unit file.
type Options ¶ added in v1.8.0
type Options struct {
// When set, generate service files in the current working directory and
// return the paths to these files instead of returning all contents in one
// big string.
Files bool
// New controls if a new container is created or if an existing one is started.
New bool
}
Options include different options to control the unit file generation.
Click to show internal directories.
Click to hide internal directories.