mirror of
				https://github.com/containers/podman.git
				synced 2025-11-04 08:56:05 +08:00 
			
		
		
		
	when running in rootless mode and using systemd as cgroup manager create automatically a systemd scope when the user doesn't own the current cgroup. This solves a couple of issues: on cgroup v2 it is necessary that a process before it can moved to a different cgroup tree must be in a directory owned by the unprivileged user. This is not always true, e.g. when creating a session with su -l. Closes: https://github.com/containers/libpod/issues/3937 Also, for running systemd in a container it was before necessary to specify "systemd-run --scope --user podman ...", now this is done automatically as part of this PR. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
		
			
				
	
	
		
			15 lines
		
	
	
		
			347 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			347 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// +build !linux
 | 
						|
 | 
						|
package cgroups
 | 
						|
 | 
						|
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
 | 
						|
func IsCgroup2UnifiedMode() (bool, error) {
 | 
						|
	return false, nil
 | 
						|
}
 | 
						|
 | 
						|
// UserOwnsCurrentSystemdCgroup checks whether the current EUID owns the
 | 
						|
// current cgroup.
 | 
						|
func UserOwnsCurrentSystemdCgroup() (bool, error) {
 | 
						|
	return false, nil
 | 
						|
}
 |