diff --git a/docs/containers.conf.5.md b/docs/containers.conf.5.md index bf227bee9..3e539d784 100644 --- a/docs/containers.conf.5.md +++ b/docs/containers.conf.5.md @@ -522,6 +522,11 @@ the location of the container/storage tmp directory will be used. If set then it is the users responsibility to cleanup storage. Configure tmpfiles.d(5) to cleanup storage. +**service_timeout**=**5** + +Number of seconds to wait without a connection before the +`podman system service` times out and exits + **static_dir**="/var/lib/containers/storage/libpod" Directory for persistent libpod files (database, etc). diff --git a/pkg/config/config.go b/pkg/config/config.go index b982aa552..c1f63577a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -335,7 +335,7 @@ type EngineConfig struct { // ActiveService index to Destinations added v2.0.3 ActiveService string `toml:"active_service,omitempty"` - // Destinations mapped by service Names + // ServiceDestinations mapped by service Names ServiceDestinations map[string]Destination `toml:"service_destinations,omitempty"` // RuntimePath is the path to OCI runtime binary for launching containers. @@ -379,6 +379,10 @@ type EngineConfig struct { // containers/storage. As such this is not exposed via the config file. StateType RuntimeStateStore `toml:"-"` + // ServiceTimeout is the number of seconds to wait without a connection + // before the `podman system service` times out and exits + ServiceTimeout uint `toml:"service_timeout,omitempty"` + // StaticDir is the path to a persistent directory to store container // files. StaticDir string `toml:"static_dir,omitempty"` diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 971a6d552..4c9d1f155 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -28,6 +28,7 @@ var _ = Describe("Config", func() { gomega.Expect(err).To(gomega.BeNil()) gomega.Expect(defaultConfig.Containers.ApparmorProfile).To(gomega.Equal(apparmor.Profile)) gomega.Expect(defaultConfig.Containers.PidsLimit).To(gomega.BeEquivalentTo(2048)) + gomega.Expect(defaultConfig.Engine.ServiceTimeout).To(gomega.BeEquivalentTo(5)) path, err := defaultConfig.ImageCopyTmpDir() gomega.Expect(err).To(gomega.BeNil()) gomega.Expect(path).To(gomega.BeEquivalentTo("/var/tmp")) @@ -213,6 +214,7 @@ image_copy_tmp_dir="storage"` gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap)) gomega.Expect(defaultConfig.Containers.HTTPProxy).To(gomega.Equal(false)) gomega.Expect(defaultConfig.Engine.HelperBinariesDir).To(gomega.Equal(helperDirs)) + gomega.Expect(defaultConfig.Engine.ServiceTimeout).To(gomega.BeEquivalentTo(300)) }) It("test GetDefaultEnvEx", func() { diff --git a/pkg/config/containers.conf b/pkg/config/containers.conf index dc38f8ec6..433d81c78 100644 --- a/pkg/config/containers.conf +++ b/pkg/config/containers.conf @@ -466,6 +466,11 @@ default_sysctls = [ # container/storage tmp directory will be used. # image_copy_tmp_dir="/var/tmp" +# Number of seconds to wait without a connection +# before the `podman system service` times out and exits +# +#service_timeout = 5 + # Directory for persistent engine files (database, etc) # By default, this will be configured relative to where the containers/storage # stores containers diff --git a/pkg/config/default.go b/pkg/config/default.go index 5ce73bd2a..e6a81f472 100644 --- a/pkg/config/default.go +++ b/pkg/config/default.go @@ -257,6 +257,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) { c.ImageBuildFormat = "oci" c.CgroupManager = defaultCgroupManager() + c.ServiceTimeout = uint(5) c.StopTimeout = uint(10) c.Remote = isRemote() diff --git a/pkg/config/testdata/containers_default.conf b/pkg/config/testdata/containers_default.conf index f23d7eee1..c494da052 100644 --- a/pkg/config/testdata/containers_default.conf +++ b/pkg/config/testdata/containers_default.conf @@ -184,6 +184,11 @@ infra_image = "k8s.gcr.io/pause:3.4.1" # Default command to run the infra container infra_command = "/pause" +# Number of seconds to wait without a connection +# before the `podman system service` times out and exits +# +service_timeout=300 + # Determines whether engine will reserve ports on the host when they are # forwarded to containers. When enabled, when ports are forwarded to containers, # they are held open by conmon as long as the container is running, ensuring that