Merge pull request #19932 from lsm5/podmansh-timeout

Podmansh: use podmansh_timeout
This commit is contained in:
OpenShift Merge Robot
2023-09-12 21:23:31 +02:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
_ "github.com/containers/podman/v4/cmd/podman/completion"
@ -43,9 +44,7 @@ func main() {
(len(os.Args[0]) > 0 && filepath.Base(os.Args[0][1:]) == registry.PodmanSh) {
shell := strings.TrimPrefix(os.Args[0], "-")
// The wait timeout will soon be made configurable via the
// upcoming `podmansh_timeout` option in containers.conf
args := []string{shell, "exec", "-i", "--wait", "30"}
args := []string{shell, "exec", "-i", "--wait", strconv.FormatUint(uint64(registry.PodmanConfig().ContainersConfDefaultsRO.Engine.PodmanshTimeout), 10)}
if term.IsTerminal(0) || term.IsTerminal(1) || term.IsTerminal(2) {
args = append(args, "-t")
}

View File

@ -20,6 +20,8 @@ Systemd will automatically create the container when the user session is started
Administrators can use volumes to expose specific host data from the host system to the user, without the user being exposed to other parts of the system.
Timeout for podmansh can be set using the `podmansh_timeout` option in containers.conf.
## Setup
Create user login session using useradd while running as root.
@ -126,7 +128,7 @@ _EOF
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-exec(1)](podman-exec.1.md)**, **quadlet(5)**
**[containers.conf(5)](containers.conf.5.md)**, **[podman(1)](podman.1.md)**, **[podman-exec(1)](podman-exec.1.md)**, **quadlet(5)**
## HISTORY
May 2023, Originally compiled by Dan Walsh <dwalsh@redhat.com>