cri-o: Unable to run a process in the background

What happened?

Using kubectl exec or crictl on cri-o based containers, am trying to run a command in the background, but unable to do so. Ex :

 /tmp# date; crictl exec -i 4821 /bin/bash -c "nohup sleep 10 & " ; date
Thu Dec 28 09:40:11 UTC 2023
Thu Dec 28 09:40:21 UTC 2023
/tmp#

What did you expect to happen?

From the above command, like in the case of docker exec, the nohup command should have returned immediately, but it does not. I get control only after the sleep command runs for 10s

How can we reproduce it (as minimally and precisely as possible)?

Run the above command on any container

Anything else we need to know?

No response

CRI-O and Kubernetes version

$ crio --version
crio version 1.24.4
Version:          1.24.4
GitCommit:        69945ab622a70ab01f4b0df10b107bc48e38dc9e
GitTreeState:     clean
BuildDate:        2023-06-14T16:22:54Z
GoVersion:        go1.19.9
Compiler:         gc
Platform:         linux/amd64
Linkmode:         dynamic
BuildTags:        exclude_graphdriver_devicemapper, seccomp, selinux
SeccompEnabled:   true
AppArmorEnabled:  false
$ kubectl version --output=json
{
  "clientVersion": {
    "major": "1",
    "minor": "24",
    "gitVersion": "v1.24.13-ves",
    "gitCommit": "7bebfe5dd7222ed749dfa9f1c47f41b45dbea0d7",
    "gitTreeState": "clean",
    "buildDate": "2023-05-29T14:45:00Z",
    "goVersion": "go1.19.8",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "kustomizeVersion": "v4.5.4",
  "serverVersion": {
    "major": "1",
    "minor": "24",
    "gitVersion": "v1.24.13",
    "gitCommit": "49433308be5b958856b6949df02b716e0a7cf0a3",
    "gitTreeState": "clean",
    "buildDate": "2023-04-12T12:08:36Z",
    "goVersion": "go1.19.8",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

OS version

# On Linux:
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7.2009.46 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7.2009.46 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
OSTREE_VERSION=7.2009.46
$ uname -a
Linux master-0 4.18.0-240.10.1.ves3.el7.x86_64 #1 SMP Wed Oct 4 19:00:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Additional environment details (AWS, VirtualBox, physical, etc.)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@PiyushRaj927, these events look like API access logs, perhaps? I don’t know what these are precisely.

For CRI-O, you can enable the debug log level (or even “trace”—very verbose) and start the CRI-O process in the foreground to get the output directly into your terminal, which is helpful for troubleshooting.

Would this help?