Bug 2170444

Summary: podman system service not work with rootless user under cgroupv1
Product: Red Hat Enterprise Linux 9 Reporter: Yuhui Jiang <yujiang>
Component: podmanAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED UPSTREAM QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.2CC: bbaude, dwalsh, gscrivan, jnovy, lsm5, mboddu, mheon, pthomas, tsweeney, umohnani, ypu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-21 10:34:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yuhui Jiang 2023-02-16 11:38:40 UTC
Description of problem:
testcase "podman-system-service containers survive service stop" fail in 251-system-service.bats, this only found in cgroupv1 and runtime for crun.
When the system is cgroupv2, this case will success.

Version-Release number of selected component (if applicable):
podman-4.4.0-1.el9.x86_64

How reproducible:
100%


Steps to Reproduce:
1. set up cgroupv1 in RHEL9
2. check runtime is "crun"
3. bats 251-system-service.bats


Actual results:
[test@kvm-07-guest27 system]$ bats 251-system-service.bats
251-system-service.bats
 ✓ podman systerm service <bad_scheme_uri> returns error
 ✗ podman-system-service containers survive service stop
   (from function `is' in file helpers.bash, line 689,
    in test file 251-system-service.bats, line 50)
     `is "$output" "true" "Container is still running after podman server stops"' failed
   $ podman rm -t 0 --all --force --ignore
   $ podman ps --all --external --format {{.ID}} {{.Names}}
   $ podman images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
   quay.io/libpod/testimage:20221018 f5a99120db64
   Running as unit: podman-service-SEC0EgR1iw.service
   $ podman --url tcp://127.0.0.1:5245 run -d --name keeps-running quay.io/libpod/testimage:20221018 top -d 2
   Resource limits are not supported and ignored on cgroups V1 rootless systems
   7691f04bdd2d56af2daa61eba160a9d5e10ac85219b00ddbffb7da9aa56ce587
   $ podman container inspect -l --format {{.State.Running}}
   true
   $ podman container inspect keeps-running --format {{.State.Running}}
   false
   #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
   #|     FAIL: Container is still running after podman server stops
   #| expected: 'true'
   #|   actual: 'false'
   #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   # [teardown]
   $ podman pod rm -t 0 --all --force --ignore
   $ podman rm -t 0 --all --force --ignore
   7691f04bdd2d56af2daa61eba160a9d5e10ac85219b00ddbffb7da9aa56ce587
   $ podman network prune --force
   $ podman volume rm -a -f
 ✓ podman --host / -H options

3 tests, 1 failure



Expected results:
the testcase should success.

Additional info:

Comment 2 Giuseppe Scrivano 2023-02-17 08:10:04 UTC
that is probably related to not creating a cgroup when running rootless on cgroupv1.  Since anyway we cannot apply limits we don't even create one.

Before we invest time into this issue, how much do we care about this specific configuration (rootless + system service + cgroupv1) given the default on RHEL 9 is cgroupv2?

Comment 3 Giuseppe Scrivano 2023-02-17 08:55:40 UTC
another problem: we will need to fix the OCI runtimes to create the scope and not try to configure it; so it is not only Podman but we need to change crun and runc as well.  My vote is to skip the test and just add a warning to podman system service when it runs on rootless cgroupv1

Comment 4 Daniel Walsh 2023-02-17 15:26:14 UTC
I agree the test should be disabled, This is not something we want to support.

Comment 5 Tom Sweeney 2023-02-20 19:50:56 UTC
Thanks for the input all.  Giuseppe, please create a warning message upstream, and we'll close this out once it's merged.  Yiqiao, please diable this test.

Comment 6 Giuseppe Scrivano 2023-02-21 10:34:06 UTC
opened a PR: https://github.com/containers/podman/pull/17589

I don't think there is a need to track or backport this minor warning message, so I am closing the issue